- Python Social Media Analytics
- Siddhartha Chatterjee Michal Krystyanczuk
- 145字
- 2021-07-15 17:24:57
Selecting the endpoint
An endpoint indicates where a particular resource can be accessed. It is represented by an URL that contains the name of the action. Even though there are multiple endpoints for each API, we will focus on those used in the next chapters of the book. All other endpoints/actions you can find in the official API documentation.
The Twitter REST API allows clients to retrieve a sample of tweets based on search criteria. The search request is made up of a Boolean query with some additional optional parameters (to, from, list, url, and filter). We will store the endpoint URL for this resource in a url variable:
url_rest = "https://api.twitter.com/1.1/search/tweets.json"
Similarly, we will use an endpoint URL for the Streaming API that returns a random sample stream of statuses:
url_streaming = "https://stream.twitter.com/1.1/statuses/sample.json"
We will use both variables to retrieve and parse the data.
- HTML5+CSS3+JavaScript從入門到精通:上冊(微課精編版·第2版)
- Python for Secret Agents:Volume II
- 數(shù)據(jù)結(jié)構(gòu)和算法基礎(Java語言實現(xiàn))
- Hands-On JavaScript High Performance
- C語言程序設計案例式教程
- Learning Salesforce Einstein
- Learning FuelPHP for Effective PHP Development
- Mastering ArcGIS Enterprise Administration
- Python:Deeper Insights into Machine Learning
- Android Studio Cookbook
- LabVIEW數(shù)據(jù)采集
- 快樂編程:青少年思維訓練
- Getting Started with hapi.js
- AngularJS by Example
- Prezi Cookbook