PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 6, 2022

[FIXED] How to managed facebook post in own database for better manipulation?

 January 06, 2022     algorithm, cron, facebook-graph-api, facebook-php-sdk, php     No comments   

Issue

Imagine I want to store in my database the facebook posts from a user/page for getting them and manipulate them simplier.

I will make a php script that will be launch every day for each user/page who will get the posts I don't already have in my database and insert them.

Now, on my front website, you can log in, and see your posts.

Now, you go on facebook, and modify one of your post.

Now you come again on my website, and obviously, you don't see the modification you did on facebook, because this modification is on facebook database and not in mine, and your posts a retrived from my Database.

Theorically, one of the solution will be that facebook has a "log" table for posts, where i can find something like "this posts has be updated" so i can update my table. Something like that exist ?

If not i have a second solution, at each posts send from my server to my website, update it automatically with facebook database (getById the post on fb an update it in my db) and after that send the posts to my website. But this will be a mess and a lot of request for nothing.

So how can i do this ? Someone have already tried this ? Or only directly manage the posts from facebook database ?

Thanks =)


Solution

Facebook has a mechanism to send updates to you, called webhooks.

https://developers.facebook.com/docs/graph-api/webhooks

You can subscribe to several fields for users or pages, among them the feed.

You’ll have to check if it delivers updates to already existing posts as well - but I think it should, would make little sense if it didn’t.



Answered By - CBroe
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing