- Python Social Media Analytics
- Siddhartha Chatterjee Michal Krystyanczuk
- 174字
- 2021-07-15 17:24:58
Selecting the endpoint
The main endpoint for Graph API which permits to access the Facebook resources. However, we have to specify which node we want to query and the other parameters we send to the API.
url = 'https://graph.facebook.com/v2.8/'
We will use version 2.8 of Facebook Graph API. There are small differences between versions, mostly in available endpoints, resources, and parameters. We use the basic functionalities of this API so switching between versions should not cause any problems in terms of endpoints and resources, but we have to check the documentation to pass the right arguments.
The are several scenarios we might be interested in. The first one is retrieving all the comments from a public page of a brand:
page_url = 'https://graph.facebook.com/v2.8/{page-id}/feed'
An example using Mercedes Benz France:
page_url = 'https://graph.facebook.com/v2.8/MercedesBenzFrance/feed'
In some cases, {page-id} may be represented by a number.
We can use the same logic to access another kind of resource such as photos for example:
page_url = 'https://graph.facebook.com/v2.8/{page-id}/photos'
All available resources are described in the official documentation for the API.
- 程序員修煉之道:程序設計入門30講
- 嵌入式軟件系統測試:基于形式化方法的自動化測試解決方案
- Mastering Spring MVC 4
- HTML5+CSS3+JavaScript Web開發案例教程(在線實訓版)
- INSTANT Django 1.5 Application Development Starter
- Learning Salesforce Einstein
- Symfony2 Essentials
- 軟件品質之完美管理:實戰經典
- IBM Cognos TM1 Developer's Certification guide
- Oracle 12c從入門到精通(視頻教學超值版)
- 計算語言學導論
- JavaScript編程精解(原書第2版)
- 零基礎學Java第2版
- 交互設計師成長手冊:從零開始學交互
- 啊哈C語言?。哼壿嫷奶魬穑ㄐ抻啺妫?/a>