1

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?

Geekuna Matata
  • 1,349
  • 5
  • 19
  • 38

2 Answers2

3

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:

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/

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • Is there any limit to how many calls I can make? One page may have a thousand posts. Combined with 50 pages or so, it would be around 50,000 calls to check whether each post is up or not. – Geekuna Matata Jul 14 '14 at 19:45
  • about api limits: http://stackoverflow.com/questions/8713241/whats-the-facebooks-graph-api-call-limit – andyrandy Jul 14 '14 at 19:49
  • if you want to check for many posts per page, it may be better to get the posts with a feed api call instead of checking out every single post with his id. less api calls. – andyrandy Jul 14 '14 at 19:50
  • Thank you. Please do add any more details I should know about the feed api call. – Geekuna Matata Jul 14 '14 at 20:06
2

You can use graph api for this. If it's a public page, you can follow these steps:

  1. Create your application in Facebook developers site
  2. Setup the basic graph auth mechanism with your favorite language and get unexpired token.
  3. 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
  4. Add post title, postID to your database.
  5. 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.
artuc
  • 913
  • 11
  • 20