我是Facebook4j的新手,我正在寻找一种使用它发布消息的方法。我刚刚在互联网上学到了很少的编码。请有人帮助我。
这就是我所做的:
import facebook4j.Facebook;
import facebook4j.FacebookException;
import facebook4j.FacebookFactory;
import facebook4j.conf.Configuration;
import facebook4j.conf.ConfigurationBuilder;
public class post {
public static void main(String[] args)
throws FacebookException
{
// Create conf builder and set authorization and access keys
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
configurationBuilder.setDebugEnabled(true);
configurationBuilder.setOAuthAppId("xxxx");
configurationBuilder.setOAuthAppSecret("xxxx");
configurationBuilder.setOAuthAccessToken("xxxx");
configurationBuilder .setOAuthPermissions("email, publish_stream, id, name, first_name, last_name, read_stream , generic");
configurationBuilder.setUseSSL(true);
// Create configuration and get Facebook instance
Configuration configuration = configurationBuilder.build();
FacebookFactory ff = new FacebookFactory(configuration);
Facebook Facebook = ff.getInstance();
Facebook.postStatusMessage("Hello World from Facebook4J.");
}
}
那么,接下来我需要做什么?