RestFBFacebook API 的 Java 封装请求处理组件
一款facebook获取及数据处理的开源组件。
比较spring的social组件优点是没有太多的封装,缺点是支持facebook,spring的是啥都支持。
示例代码:
// Searching is just a special case of fetching Connections -
// all you have to do is pass along a few extra parameters.
Connection<Post> publicSearch =
facebookClient.fetchConnection("search", Post.class,
Parameter.with("q", "watermelon"), Parameter.with("type", "post"));
Connection<User> targetedSearch =
facebookClient.fetchConnection("me/home", User.class,
Parameter.with("q", "Mark"), Parameter.with("type", "user"));
out.println("Public search: " + publicSearch.getData().get(0).getMessage());
out.println("Posts on my wall by friends named Mark: " + targetedSearch.getData().size());
评论