restfb

facebook real time update in java example

不羁的心 提交于 2019-12-05 06:41:23
问题 I'm working on a project which uses Facebook Graph Api to collect information about the public posts. There is a need to update this data Real-Time when changes come to this posts. i have seen a real time update mechanism using call back url https://developers.facebook.com/docs/graph-api/reference/app/subscriptions/ and https://developers.facebook.com/docs/graph-api/real-time-updates/ .. But i didnt get any idea of doing this in java. Please somebody help me using an example. 回答1: Real time

Facebook emails always return null through FQL and RestFB

柔情痞子 提交于 2019-12-05 06:15:59
I'm trying to convert friend pages into fan pages (most businesses have created friend pages by mistake) and am trying to email everyone on a friend list about the move. I've tried FQL "SELECT email FROM user WHERE uid=xxxx" Creating groups (not good for 5000 friend pages) Restfb: Connection myFriends = facebookClient.fetchConnection("me/friends", User.class) etc; The FQL and RestFB methods are both returning nada, group email method is just plain messy. Is this a security feature or can this data ever by returned for my purpose? Cheers to access user's private informations like email,posts

how do i share a post on facebook using restfb

泪湿孤枕 提交于 2019-12-03 16:42:32
this is my java code using resfb lib to post something on my facebook groups feed: FacebookClient fb=new DefaultFacebookClient(token); FacebookType message=fb.publish(pid+"/feed",FacebookType.class,Parameter.with("message", description)); now what do i do to share posted article? thanks a lot for your help! Graph API doesn't provide an explicit share operation, but you can create a post which is a link to another post, which should be displayed as a share. Something like this: fb.publish("me/feed", FacebookType.class, Parameter.with("link", "https://www.facebook.com/10152237769155733")); 来源:

How to fetch more than 25 post messages

荒凉一梦 提交于 2019-12-03 12:34:58
I'm trying to get all post messages using restfb, my code is as follows public Connection<Post> publicSearchMessages(Date fromDate, Date toDate) { Connection<Post> messages = publicFbClient.fetchConnection("search", Post.class, Parameter.with("q", "Watermelon"), Parameter.with("since", fromDate), Parameter.with("until", toDate), Parameter.with("type", "post")); return messages; } This only gives latest 25 post messages. Parameter.with("limit",100 ) If i set limit parameter, it gives 100 messages but i don't want to limit to fetching post messages. So, Is there anyway I can get a full list of

How to post to page as an app?

女生的网名这么多〃 提交于 2019-12-02 20:49:10
问题 So, I have an app (facebook app entity), and I have a page. I want to post to the page using the app, through the java code (by restfb, or any other suggestion). Looks like I am missing the phase where the page gives permission to the app to post. No idea how to do it. Thank you all. Uri. 回答1: You can only post "as Page", not "as App". You need a Page Access Token and you need to use the /page-id/feed endpoint to post. Links with information and example code: https://developers.facebook.com

Searching public posts on facebook

元气小坏坏 提交于 2019-12-02 19:41:20
问题 I'm developing a Java business application and I need to search public posts on Facebook that contain specific keywords. I tried using the RestFB library but I quickly realised that making a public search for posts is not supported any more by the Facebook Graph API. So, my question is the following: is there another way to search for Facebook posts? 回答1: No, there is no other way. Public Post Search has been removed a long time ago and there is no alternative. There is only this one, but you

How to post to page as an app?

左心房为你撑大大i 提交于 2019-12-02 09:52:32
So, I have an app (facebook app entity), and I have a page. I want to post to the page using the app, through the java code (by restfb, or any other suggestion). Looks like I am missing the phase where the page gives permission to the app to post. No idea how to do it. Thank you all. Uri. You can only post "as Page", not "as App". You need a Page Access Token and you need to use the /page-id/feed endpoint to post. Links with information and example code: https://developers.facebook.com/docs/facebook-login/access-tokens/ https://developers.facebook.com/docs/graph-api/reference/v2.1/page/feed/

Post to Facebook Page wall using RestFB api

只愿长相守 提交于 2019-12-01 07:35:46
I am trying to post on the wall of a facebook page. I am able to post on the user wall using App Access token. I got the App Access Token through extending the DefaultFacebookClient public class ConnectionService extends DefaultFacebookClient{ public ConnectionService(String appId, String appSecret) { AccessToken accessToken = this.obtainAppAccessToken(appId, appSecret); this.accessToken = accessToken.getAccessToken(); } } With this I am able to post to user wall using the appID and appSecret. But when I tried to post to Page Wall i get error of " The user hasn't authorized the application to

Post to Facebook Page wall using RestFB api

二次信任 提交于 2019-12-01 05:13:38
问题 I am trying to post on the wall of a facebook page. I am able to post on the user wall using App Access token. I got the App Access Token through extending the DefaultFacebookClient public class ConnectionService extends DefaultFacebookClient{ public ConnectionService(String appId, String appSecret) { AccessToken accessToken = this.obtainAppAccessToken(appId, appSecret); this.accessToken = accessToken.getAccessToken(); } } With this I am able to post to user wall using the appID and appSecret

RestFB: Using a facebook app to get the users Access Token

柔情痞子 提交于 2019-11-30 06:55:46
This is what i have: static AccessToken accessToken = new DefaultFacebookClient().obtainExtendedAccessToken("<my app id>", "<my app secret>"); static FacebookClient client = new DefaultFacebookClient(); public static void main(String args[]) { System.out.print("Enter Your Status: "); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String status= null; try { userName = br.readLine(); System.out.println(".........."); } catch (IOException ioe) { System.out.println("!"); System.exit(1); } FacebookType publishMessageResponse = client.publish("me/feed", FacebookType.class,