Python Social Media Analytics
上QQ阅读APP看书,第一时间看更新

Creating an app and getting an access token

We show the following procedure to get access tokens that never expire.

  1. Go to the website: https://developers.facebook.com/apps/.
  2. Create an application.
  3. Go to https://developers.facebook.com/tools/explorer.
  4. Select your application from the Graph API Explorer drop-down menu.
  5. Click on the Get Access Token button.
  6. Select permissions from the form.
  7. In the Access token input field click on the blue exclamation point icon. It will open a pop-up window.
  8. In the pop-up window, click on Open in Access Token Tool. You will see token details. At this stage the token is valid for around one hour.
  9. Click on the Extend Access Token button to get a token that will never expire.

You can save the token and use it in your application to collect data from Facebook. It is worth noticing that you will only have access to public information on Facebook. Your application has to have the right to access the data you wish to collect. In our case it is straightforward, because we will analyze public conversation around brands.