How to get facebook page posts without using facebook api? - php

I am trying to make a simple webpage that will just display the most recent, let's say 5, posts from a certain facebook page. I have tried so many ways to use the Facebook API, but no matter what I do, it either returns nothing, or I get an access denied message. I am an admin of the page.
What is the best way to do this with PHP? If there is no other way to get facebook posts, what is the best way to use the API?
I would also like to get the post URL, not the contents of the post.

I found a way using zapier.com. Thanks!

First, you need to get either the user/page access token. Then, you will be able to get the last 5 posts using: https://graph.facebook.com/{YOUR_PAGE_ID}/posts?access_token={YOUR_ACCESS_TOKEN}&limit=5

Related

Facebook Graph API only get own posts without shared posts

I'm new to the Facebook API with PHP, and so far, I've succeeded in retrieving all the posts for my feed. But, I want to retrieve only the posts I have published, so nothing I have shared (that's what's included when I use the /posts) nor do I want messages placed on my feed by someone else (that's what I get using /feed)
Below an example of my call:
$data = file_get_contents("https://graph.facebook.com/$page_name/posts?limit=$limit&access_token=$access_token");
Any thoughts on this? Should I be using the facebook PHP SDK, or can it be done with a file_get_contents?
I have tried the "&with=" location filter, but I have no idea what that should do. Also I have tried adding "?filter=" app_$app_id, but that had no effect either.
As per CBroe's comment, this is not possible and needs additional code.

In Graph API how can I get who mentioned me

I'm using Graph API to fetch my page feeds. I call
$pageID/feed?fields=created_time,object_id,story_tags,story,full_picture,picture,message_tags,message,caption,child_attachments,attachments,description,admin_creator,from
It gives me the feeds in my page which is fine. But, I also want the list of posts where anyone has mentioned my page in their posts in their own walls. I have gone through https://developers.facebook.com/docs/graph-api/reference/v2.9 but could not find a way to do that. Does anyone has any idea if that is possible?
If yes, then how?
There is the /{page-id}/tagged endpoint; but that will only return posts by other pages that have tagged yours, and only if those pages are “authentic” (which likely means verified.)
And user posts are not available at all to your app, not even if they are public - unless the user explicitly granted your app permission to read their posts.

Get my posts on facebook manage page

I need get ME posts in one of my manage pages, with the new version of facebook sdk.
Example:
I'm manage on Page A, and add a post in my name Adexe Rivera, and in this page there are a lot of posts. So I want to filter only posts by Adexe Rivera.
I know for get posts on pages it's necesary /page/feed, but I need add the filter from user.
I tried with Graph Api Explorer, with this FQL:
SELECT source_id, actor_id, post_id, target_id, message FROM stream WHERE source_id = "PAGE_ID" AND actor_id = "MY_ID"
and get the information that I'm searching.
But I know that since v2.0 FQL not works for sdk, so that I need it's make the same like FQL works in this version of graph
I already tried what documentation said, but not get my posts.
A user access token is required to retrieve posts visible to that person.
Thanks in advance
Filtering is not possible, you can only use the existing endpoints and filter on your own after getting the entries. There are several different endpoints, make sure you are using the correct one. They are all documented very well: https://developers.facebook.com/docs/graph-api/reference/v2.4/page/feed
Also, an App Access Token should be enough to get access to the endpoints if it´s a public post on a non-restricted Page:
An access token is required to view publicly shared posts.
If you don´t know about Access Tokens, read those articles:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Finally, it is not possible to use FQL giving me the expected result, so getting the "from" field in the /PAGEID/feed endpoint, and filtering the results, I get what I wanted.
Thanks for your answers and for their penalties, I have spent several days trying to maximize the performance of the SDK facebook.
Cheers

get facebook posts (and older posts) without access token

i already found a way to get posts without an access token:
https://www.facebook.com/feeds/page.php?format=rss20&id=121136164607942
https://www.facebook.com/feeds/page.php?format=atom10&id=121136164607942
With the URLs above you can get the newest posts, but what about the older ones? I basicly wanna achive what facebook already got (load the newest posts and then there will be a button "load more"). Including an IFrame is not an option. I want to make the facebook posts responsive.
Does somebody know if theres a way to get the older posts? I already tried adding &offset=10 but it doesnt seem to affect anything.
The old Page Feed endpoint will stop working soon. Use /v2.3/{page_id}/feed instead, then you can also use the since parameter.
See
https://developers.facebook.com/docs/apps/changelog#v2_3_90_day_deprecations
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#paging
Page RSS Feed endpoint - at https://www.facebook.com/feeds/page.php is now deprecated and will stop returning data from June 23, 2015. Developers should call the Graph API's /v2.3/{page_id}/feed endpoint instead. This returns JSON rather than RSS/XML.

get facebook subscribers numbers without access token?

i want to get profile subscribers(followers) number of some people, and use it at my website.
is it possible to do so without getting an access token?
i already search and found this, and according to this https://developers.facebook.com/docs/graph-api/reference/app/subscriptions/ i must have the user to approve, but i wonder if there is a way to do it anyway, because this number is public.
thanks
Well, if you're able to identify the HTML element in which the number resides, you could just fetch the DOM and look for the element's content.
Here's a plugin example.
That's not working, because you need "user_subscriptions" permission as stated here: https://developers.facebook.com/docs/reference/fql/subscription/
You have a wrong link to the Graph API docs in your question, this is not about app subscriptions (Realtime API) I guess...

Categories