Using Processing and the Temboo library to update a status to Facebook but I am encountering the following error: "The type Post is ambiguous" with this line seeming to be the highlighted cause "Post postChoreo = new Post(session);". Any advice on how to resolve this would be excellent.
import com.temboo.core.*;
import com.temboo.Library.Facebook.Publishing.*;
// Create a session using your Temboo account application details
TembooSession session = new TembooSession("dylabaloo", "myFirstApp",
"xxxxxxxxxxxxxxxxxxxx");
void setup() {
// Run the Post Choreo function
runPostChoreo();
}
void runPostChoreo() {
// Create the Choreo object using your Temboo session
Post postChoreo = new Post(session);
// Set inputs
postChoreo.setAccessToken("xxxxxxxxxxxxxxxxxx");
postChoreo.setMessage("Your High Score is:");
// Run the Choreo and store the results
PostResultSet postResults = postChoreo.run();
// Print results
println(postResults.getResponse());
}
Just looking at the code and the error you are getting, i guess that Post class could exist in both com.temboo.core.* package and also in com.temboo.Library.Facebook.Publishing.* package or in the same package, where you wrote your class.
I guess you are trying to use Facebook publishing Post so you should import Post as the following to avoid ambiguity. import com.temboo.Library.Facebook.Publishing.Post;
It is not a good idea to import using wildcards. One, you will run into such issues because same class names could be existing in multiple packages imported using wildcards. Second, it is just too much un-necessary classes imported. Third, It is just not a good coding practice.
Most IDEs, especially all eclispe based IDEs, provide easy shortcuts to organize imports (like Ctrl-Shift-O for windows), which can help you organize your imports and avoid such issues.