我正在使用 Facebook4j 通过关键字获取状态
facebook4j.conf.ConfigurationBuilder fac = new facebook4j.conf.ConfigurationBuilder();
fac.setDebugEnabled(true)
.setOAuthAppId("******")
.setOAuthAppSecret("********")
.setOAuthPermissions("email,publish_stream,...");
FacebookFactory ff = new FacebookFactory(fac.build());
facebook = ff.getInstance();
new Thread(new Runnable() {
@Override
public void run() {
try {
search();
}
catch (Exception e) {
// TODO: handle exception
System.out.println(e +" ERROOOOOOR");
}}}).start();
}
//search
public void search() throws Exception {
ResponseList<JSONObject> results = facebook.search("%23morocco");
System.out.println(results);
for (JSONObject result : results) {
System.out.println(result);
}
results = facebook.search("orange", new Reading().until("yesterday"));
System.out.println(results);
for (JSONObject result : results) {
System.out.println(result);
}
}
我用 facebook api 密钥替换*我有一个异常问题,错误是:java.lang.IllegalStateException: No Token available。错误的