Until a few days ago the Python script I was using to generate an RSS feed for my own Facebook News Feed was working fine. The script I was using first signed on to Facebook using my log in information and then called up this page and parsed it for an access token:
http://developers.facebook.com/docs/reference/api
I'm not sure that is exactly the way Facebook wants people to get an access token, but reading through all the information on Graph API I can't seem to find anything that says, "Here's how you get that token you need to access your own stuff." It all seems to be directed at people trying to do far fancier stuff.
How do I obtain an access token such that the page referenced here will return the JSON format data I need?
res = browser.open('https://graph.facebook.com/me/home?access_token=%s' % acct)
Start by reading about Access Tokens as there are different types.
Then, to read the user news feed (home connection), you need a user access_token
To retrieve one using the server-side method, you need to follow this document
To understand the flow of the server-side method you can refer to this diagram (source: Login Architecture document ):
Related
I am getting only limitted number of feeds i.e**(25 feeds**) from my facebook grapg api and is their any option to get more feeds and i mentioned limit=200 in my URL but i am getting only 25.URL is https://graph.facebook.com/v2.2/me/posts?access_token={access_token}&limit=200.Is their any way to get this please suggest me
First get an access token, then retrieve all your feed. Please note that you may need to reiterate the request as the returned content is paginated (that is, ['paging']['next'] element exists inside the answer).
See also the official documentation.
The Developer Roadmap states in the Graph API search changes paragraph:
User access tokens will be required for all search Graph API calls except Posts, Places and Pages. App access tokens may also be used for Post search Graph API calls. Places and Pages search Graph API calls will still require an App access token. Search for Applications will no longer be supported.
But this Developer Blog Post says in the Graph API search changes paragraph:
App access tokens will be required for all search Graph API calls except Places and Pages. Search for application will no longer be supported.
So the first says that I will not need an User access token to search for posts (but I may use an App access token if I want to). And the second says that I need to use an App access token. I'm confused. Which one is correct?
There are a few things regarding the search API that I would like to mention to clear your confusion.
You can use the User Access Token for the Graph API search, for all types of nodes like Post, Places and Pages and retrieve the User's view of the result which might differ from other two cases. The difference arises basically from the permissions that other have for the respective User. I would recommend this over the others basically because the result might be more User respective.
You can use App Access token to get the Public view of the data from the Graph API Search. The data retrieved might be different or same as the other cases. Using this is a best thing to do in case of doubt over what access token is to be used.
To complicate the things further, you may even get away using Graph API search without any access token (Sample request /search?type=post&q=video). Although this is highly not recommended because Facebook might just change the API anytime requiring further changes in your app.
So in short use User Access token if you would want User view of data or if you just want public data for some statistics etc. you may use App Access token.
And to answer your question You will be required to use the App Access token after July 10,2013
I'm looking into the facebook graph api. I understand that I can retrieve information about a facebook web page by making a get with the current id. It's also clear that after retrieving a access token I can post on the logged in users wall and do other operations.
But what if I want more general data? Can I, for example, get how many swedish user who have used the word "Obama" in their status update the last week?
I don't think that the current search API can be that specific. You can find everything about the search API in this document.
I develop flash websites that feature posts from a Facebook page. Since I'm not accessing a visitor's account, I don't want them to go through the oauth process. I only want one feed in Json form, but that feed is a page and not a specific user. I've gotten around this by writing a script that I visit to grant an offline_access token. I use that token to access the one feed I need. On page load, I use the graph API Json URL to get the feed and parse the data in flash.
Now that offline_access is going away, I'm trying to find the best way to access the feed in raw json form that will work in flash.
I have read this page (http://developers.facebook.com/roadmap/offline-access-removal/), and can't find a scenario that helps me as all flows require a user to access an app of some kind. Does this change mean that I can no longer access a page feed without the process being transparent to the visitor? If need be I can be asked to be an admin of the pages I need access to, if that helps.
That document outlines all your options -
If acting as the page itself you can get a token which won't expire - Scenario 5 in the document
If acting on behalf as a user you need them to come back at least every 60 days – Scenario 2 or 3 in the document
I know it is possible to get the locale of the user with getSignedRequest, and it is possible to get the locale of the user with https://graph.facebook.com/me?fields=locale once they have authorised the app. But what is the equivalent graph api url that I can use before they have authorised the app? All my code is with the graph api so I really dont want to have to switch now to using the whole facebook->getSignedRequest() stuff. I can't find it anywhere but seems silly this functionality has not been provided in graph api?
You have to pick between using the signed_request (which is sent in a POST request to all apps on Facebook) or authorizing the user.
If you don't do one of these, then you won't know what the Users ID is, so you will never be able to identify their locale.
The signed_request just requires you to be able to capture request data and then perform the parsing logic outlined in the doc linked to above - it doesn't require the use of any SDK or API, just the ability to read requests (most languages will be able to do this).