I am pulling in a facebook feed into a website I am devloping. I have got the feed to pull through but unfortunately it shows posts made onto the page by other Facebook users.
I want the feed to only show wall posts made by the page. Is this possible?
Here is the URL i am using to pull in the feed:
https://graph.facebook.com/HadleighSwimmingPool/feed?access_token=292423037531408|0cc972ba47bcdafed97f3d01a2a3bd77&limit=1
Thanks
As #CBroe said, you can use Facebook Query Language.
Here's the FQL query you need:
SELECT message FROM stream WHERE source_id=[page-id] AND actor_id=[page-id]
For testing you can use the graph api explorer tool.
Related
I wanted to fetch most popular posts from a facebook page using Graph API. I tried https://graph.facebook.com/%pageId%/posts, But with that API I am getting recent posts from page. I wanted to filter the result with most popular posts (i.e., most shared, liked and commented). Can any body help me out how to get the popular posts from the page using the graph API.
Thanks,
Siva.
You can't get popular posts directly from Facebook Graph API. You can fetch the posts using the Graph API (/{page-id}/posts), then count likes, shares or comments of a post by yourself (/{post-id}/likes, /{post-id}/comments, /{post-id}/sharedposts) and then sort all the posts.
References:
1.https://developers.facebook.com/docs/graph-api/reference/v2.3/object/comments
2.https://developers.facebook.com/docs/graph-api/reference/v2.3/object/likes
3.https://developers.facebook.com/docs/graph-api/reference/v2.3/object/sharedposts
OBJECTIVE: I need to display latest 5 entries from users timeline on website, using PHP.
Please not that i speak about timeline of user profile - not fan page, not group.
SO FAR I DID THIS:
Registered as Facebook developer
Registered app
Obtained token
Opened url: https://graph.facebook.com/USER_ID/feed?access_token=MY_TOKEN
Voila. Feed of that user is displayed now, but..
PROBLEM: So now i have users feed, but it looks like its partially working.
It happens often that it don't displays some updates, sometimes it displays just date of the post and not the content.
However when i try to grab feed from some facebook fan page, then everything work normal.
MY QUESTION: Are we allowed to grab user timeline? If yes, what im doing wrong?
You won't ever see all the information that is visible inside the Facebook app via the api. This comes from how Facebook filters out the data. See this Facebook Developers blog post for more information: https://developers.facebook.com/blog/post/478/
Yes you are allowed to to grab user timeline posts, even with a limit, if your app asks for read_stream permission. Issue an HTTP GET request to the below URL:
https://graph.facebook.com/user_id/posts?access_token=token&limit=5
I have noticed that posts from Seesmic & TripIt often aggregate & show a the app description + icon. Here's a screenshot:
I'm posting messages to a users wall with the Graph API, but I'd like to know how to make the app description show up.
I have also tried posting a few feed stories successively but they are not aggregated like in the screenshot. Any ideas how to do this?
Thanks!
I am working with Facebook graph API right now and I can confirm that there is no method to group these posts.
This is something that Facebook does at its end to help the user manage the information.
Perhaps if you try to post multiple posts at frequent intervals, Facebook considers it a developing news activity coming from the same source and groups it together.
I recently implemented this for our client. This is called Facebook aggregation
Look here :
https://developers.facebook.com/docs/technical-guides/opengraph/defining-an-aggregation/
Does anybody know how to make news feeds appear as from Facebook Page owner?
IE. I have few page admins on FB, and I have Facebook Integration on my website (PHP), and when someone posting announcements on Facebook thru the website all that feeds are appearing as personal feeds.
Thanks!
You would need to prompt the admin for the additional scope of "manage_pages", then access /me/accounts to get a list of access_token's and pages they manage, and then post a message like normal using that special access_token. There is a good walk through of this: http://www.sergiy.ca/post-on-facebook-app-wall-and-fan-page-wall-as-admin/
i'm trying to get a facebook page feeds using graph URL. but i want to get only the owner data ... i don't want anything not from the owner. i can do that using PHP. but i'm asking if i can do that using the same graph request.
Thanks
Just use /posts instead of /feed