Facebook4j邮政追踪问题

时间:2014-10-27 11:08:44

标签: java facebook facebook-graph-api

我的应用程序是一个关键字跟踪器应用程序,用于捕获与我们的业务相关的用户情绪。该应用程序运行正常。但是从最近两周开始,它没有捕获一些相关的帖子。但是,当我直接使用Facebook Graph API时,它会捕获所有帖子。这样有什么障碍吗?由于此应用程序处于生产环境中,因此我处于临界状态。请善意告诉我进一步处理。

提前致谢, 阿莎·佩雷拉



import facebook4j.Facebook;
import facebook4j.FacebookException;
import facebook4j.FacebookFactory;
import facebook4j.Post;
import facebook4j.ResponseList;
import facebook4j.conf.Configuration;
import facebook4j.conf.ConfigurationBuilder;

public class Main {

	Facebook facebook = null;

	public void initiateStream() {

		ConfigurationBuilder confBuilder = new ConfigurationBuilder();
		confBuilder.setOAuthAppId("*******");
		confBuilder.setOAuthAppSecret("********");
		confBuilder.setPrettyDebugEnabled(true);
		confBuilder.setHttpProxyHost("******");
		confBuilder.setHttpProxyPort(8080);
		confBuilder.setHttpProxyUser("*******");
		confBuilder.setHttpProxyPassword("*******");
		confBuilder

				.setOAuthPermissions("read_stream, user_status, friends_status,email, publish_stream, id, name, first_name, last_name, generic");
		confBuilder.setUseSSL(true);
		confBuilder.setJSONStoreEnabled(true);

		// Create configuration object
		Configuration configuration = confBuilder.build();

		FacebookFactory fbFactory = new FacebookFactory(configuration);
		Facebook facebook = fbFactory.getInstance();

		try {
			facebook.setOAuthAccessToken(facebook.getOAuthAppAccessToken());
			ResponseList<Post> results = facebook.searchPosts("kid_2");

			for (Post post : results) {
				System.out.println(post.getMessage());
			}

		} catch (FacebookException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		Main main = new Main();
		main.initiateStream();
	}

}
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

已使用Graph API v2弃用公开发布搜索。可能您仍然使用v1.0应用程序,但这只能保证工作到2015年4月30日。看看

https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api