Do I need to use OAuth to get a feed of latest posts from an FB group of which I am admin? - facebook

I am admin on an FB group and I want to get a feed of the latest posts for inclusion in a website. How do I do this? Excuse the simplicity of the question. However, I have done some research and I understand that I need an access_token, but do I really need to do some full oAuth stuff for a public group?

Yes you have to put access token to get feed but no need to worry this access token can't share your any details.it just a token to get feed.
You can generate your access token no. here.
https://developers.facebook.com/tools/explorer/?method=GET
And you can get feed for your page with following url:
https://graph.facebook.com/PAGE_ID/feed?access_token=ACCESS_TOKEN
Thanks

Related

How to get access token for Facebook Groups API?

Am quite new to php, facebook graph and stackoverflow so please forgive. Previously, the following in my php script worked to get an access token for a facebook group:
graph.facebook.com/oauth/access_token?client_id={$appId}&client_secret={$appSecret}&grant_type=client_credentials
What should the request be now? (I know my app-scoped user-id if that helps?)
Background: It's a simple server-to-server app to copy photos from a facebook group to a website. Therefore logins don't apply. It's been reviewed and my business verified (that was fun... not!). I've added my app to the group's settings, but can't find the next step. Any help appreciated, thanks.

Get Facebook like count using the API

I'm trying to get the number of Facebook likes using the API for the page of the organization I work for - https://www.facebook.com/giftoflife. (The number is about 150k.)
https://graph.facebook.com/110653755631234/insights/page_fans simply returns no data (I'm using the correct access token).
What am I doing wrong?
EDIT
I need to use the insights API specifically, as I need to get the likes within a specific date range.
Getting the number of likes for a Page is actually a lot easier, you donĀ“t need the insights for that, and only an App Access Token:
https://graph.facebook.com/giftoflife
You only need a User or Page Token for that if the Page is restricted (age/country).
If you want to get access to Insights, make sure you got a Page Access Token with the read_insights permission. You can debug your Access Token here: https://developers.facebook.com/tools/debug/

Is it possible to get reviews made by a user on Facebook via Graph API / FQL?

Despite all my research, I can't find a way to get this data via Graph API.
It seems that no permission matches with this...
Any idea ?
https://developers.facebook.com/docs/graph-api/reference/v2.2/page/ratings
Keep in mind that you need a Page Access Token for this, so you must be Admin of the Page. No extra permission needed, just manage_pages to get the Page Access Token, of course.
Getting the ratings for a specific User without accessing a Page is not possible afaik.

How can I detect if a certain post on a Facebook page has been deleted?

I am planning to build a small side project that stores posts from particular public pages. And detect if they delete the post later. Something similar has been done for Twitter. But I couldn't find similar projects for Facebook.
Like this: http://politwoops.sunlightfoundation.com/
But for Twitter. I will do it in Python or C#
How can I go about it?
Any particular code or projects I can learn from?
The only way to check if a post is not there anymore on Facebook is to search for it with a User Access Token of the User who posted it. Every Object on Facebook gets a specific ID, you only have to check if that ID still exists. If not, you get an Error from the API.
For example: https://developers.facebook.com/tools/explorer/?method=GET&path=10203433018378479&version=v2.0
The path parameter is the ID of the Post.
Keep in mind that you need the read_stream permission for that, and you need to let Facebook approve it for other users or it will only work for Admins/Devs of your App. It is not very likely that you will get the permission approved for this though. It usually only gets approved for Apps on "Platforms without a native Facebook experience".
Edit: My bad, i was thinking about User posts, but your question was about Pages. In that case, all you need is an App Access Token (App-ID|App-Secret). The API Call would be the same, you just need to know the Post ID.
About Access Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens/
http://www.devils-heaven.com/facebook-access-tokens/
For getting the feed of a Facebook Page, see the Facebook docs (including code samples): https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed/
You can use graph api for this. If it's a public page, you can follow these steps:
Create your application in Facebook developers site
Setup the basic graph auth mechanism with your favorite language and get unexpired token.
Use your unexpired access token to do these tasks:
Enter the id of the pages you want to crawl http://graph.facebook.com/[insert page id or url here]/feed
Add post title, postID to your database.
Create a scheduled task on your server to do these tasks:
Select all / page based etc posts on your database and send a request to: http://graph.facebook.com/[insert post ID here]
if it returns it means it's still there. otherwise it will return an error.

How do I post a link to the feed of a page via the Facebook Graph API *as* the page?

I'm working on a plugin for a Wordpress blog that posts a link to every article published to a Facebook Page associated with the blog.
I'm using the Graph API and I have authenticated myself, for the time being, via OAuth.
I can successfully post a message to the page using curl via a POST request to https://graph.facebook.com/mypageid/feed with e.g. message = "This is a test" and it published the message.
The problem is that the message is "from" my user account. I'm an admin on this test page, and when I go to Facebook and post an update from the web, the link comes "from" my page. That's how I'd like this to be set up, because it looks silly if all the shared links are coming from a user account.
Is there a way to authenticate myself as a page? Or is there an alternate way to POST to a page feed that doesn't end up being interpreted as a comment from a user?
Thanks for any thoughts or suggestions.
To post as the Page, you need to get an access token for the page by getting an access token for an admin of the Page with the "manage_pages" and "publish_stream" permissions. Then, using that access token, hit https://graph.facebook.com/me/accounts?access_token=THE_ACCESS_TOKEN. You'll get a JSON output of all the Pages that user admins and in there you'll see an access token for each Page. If you use one of those access tokens to POST your message, you will be doing so as the Page. The process is outlined in the documentation here (sorry, it's kind of buried).
Ah, it's a bug.
you need to use enable_profile_selector
http://developers.facebook.com/docs/reference/javascript/FB.login
Please have a look at the comments by "Nam Thai" on this thread: http://www.takwing.idv.hk/tech/fb_dev/faq/graphapi/graph_27.html. This solved the problem for me.