php - How to get facebook page posts on website -
Hello, I have a Facebook page (there is no app), and I want to get a recent post on my website on PHP.
I do not know where to start, I used Google to look at it but I had to find out how to get the post from the app.
Its a very comprehensive question anyway, follow these steps -
-
If you are not registered as a Facebook Developer, register here:
-
Then, create an app from here: < / li>
-
App Access Token (
app-id | app-write ) in your PHP copy script - this is required because a page To get a post from (public), you need a valid login token.
Get content using
curl or
file_get_contents of the url:
Https://graph.facebook.com/ {Page-id / page-username} / posts? Access_token = {App (you can see the result by browsing the URL in a browser) Just pars the JSON and get the post as needed. You will not receive all the posts at one time, but as a result you will find the URL on the next page.
Hope that helps!
Comments
Post a Comment