In their recent changes, Facebook now links your likes and interests with community and fan pages. How can I retrieve this information using the old rest API and Facebooker. I tried things like this to get the music preferences :
facebook_session.user.music
but I get a blank string instead of the relevant connections. Is it mandatory to use the new Graph API in order to make this work?
I believe this data can only be accessed via the Graph API.
Related
I want to get the JSON result of all the shared posts or statuses with the hashtag of my company name #company_name. How can I proceed with this. Currently I have tried with Facebook Graph Explorer Tool using the built-in access token, but this doesn't seem to give the data.
As user WizKid (Software Engineer at Facebook) states in the comments, there is no API for hash tags.
You can search through public posts using Post search in API v1.0 but this is not possible in v2.0.
I can use the Facebook Graph API successfully (within my iOS app) for several calls but I'm trying to use it for searching.
I implemented the url after googling and getting many hits, i.e. Does facebook have a public search API yet?.
I can use the search API from a browser and get results, however it doesn't work from within my app.
So I had a look at the Facebook graph API reference https://developers.facebook.com/docs/graph-api/reference/v2.0
and search isn't listed there. Has it therefore been removed?
Be aware that Facebook has just taken down public post search in Graph API v2.0 so you won't be available to do that anymore.
Check https://developers.facebook.com/docs/apps/upgrading under section Graph API "Public post search is no longer available. (/search?type=post&q=foobar)"
I'd like to use Facebook's Graph API to retrieve the official posts from a given page. This means that the wall posts must be the one's made by the page's administrators and must exclude comments made on the posts. I'm aware that the base URL for the Graph API is http://graph.facebook.com/, but I'd like to use it without an access token. Is there anyway to do this?
No. You can't retrieve the posts using a given page without an Access Token.
You can retrieve posts by performing a GET request to the following end point (and of course using a valid Access Token):
https://graph.facebook.com/{page-id}/posts?access_token=YOUR_ACCESS_TOKEN
You can also choose particular field(s) by specifying them in the URL. For example:
https://graph.facebook.com/{page-id}/posts?access_token=YOUR_ACCESS_TOKEN
&fields=message,type,likes
You can try out this example in the Facebook Graph API explorer.
Im trying to use the Facebook graph api on rails to find for a specific post who shared it. Looking through the documentation and the api data it doesn't seem that this information is available for a specific post. I am able to get the likes and comments information, however not the shares.
Would anyone know whether the current Facebook Api gives that information? Thanks
Using Graph API, do a request to graph.facebook.com/POST_ID?fields=sharedposts.
Iterate through the resulting array to get the sharers' identity.
Example in Python here.
I have looked on 100 forums looking for a simple answer for how to stream every post on a Facebook page's wall (not using the like box for just the pages posts, but everyone's posts). I am the admin of the page and I am already using the like box for my posts so I understand that, however the developer pages of Facebook are too confusing for such a simple task. I will be inserting the stream into an HTML page which will be hosted on www.1and1.com so it can handle most, if not all code.
I know it is a lot to ask but is there evem someplace online that will offer plain step-by-step instructions for my specific needs?
If the social plugins they make available aren't sufficient, you could just pull in the feed with the Facebook graph api using the javascript sdk (easiest) or there is probably an SDK for whatever programming language you know. For example, you can see a list of posts on the coca cola page using the Facebook graph explorer:
https://developers.facebook.com/tools/explorer/?method=GET&path=cocacola%2Ffeed
The /page/feed method needs an access token, but you can use the graph explorer to get an offline_access token that you can use to pull the data in. This may eliminate javascript sdk usage though unless you want to first prompt users to authenticate your application. But otherwise you would just parse the json feed that is returned in the url indicated in the graph explorer (and add your access_token to the end of the url).
Here is a good PHP tutorial on how to display a groups feed on a web page. It would be just as easy to display the posts from a page (since you are the admin)
Just replace the group ID with the page ID. Here is a link to the feed for the Facebook Platform feed graph api results. More info on FB Pages here.