- React.js Essentials
- Artemij Fedosejev
- 250字
- 2021-07-16 20:26:52
Getting data from the Twitter Streaming API
The data for our React application will come from Twitter. Twitter has the Streaming API that anyone can plug into and start receiving an endless flow of public tweets in the JSON format.
To start using the Twitter Streaming API, you'll need to perform the following steps:
- Create a Twitter account. For this, go to https://twitter.com and sign up; or sign in if you already have an account.
- Create a new Twitter App by navigating to https://apps.twitter.com, and click on Create New App. You will need to fill in the Application Details form, agree with the Developer Agreement, and click on Create your Twitter application. Now you should see your application's page. Switch to the Keys and Access Tokens tab.
In the Application Settings section of this page, you'll find two vital pieces of information:
- Consumer Key (API Key); for example,
jqRDrAlKQCbCbu2o4iclpnvem
- Consumer Secret (API Secret); for example,
wJcdogJih7uLpjzcs2JtAvdSyCVlqHIRUWI70aHOAf7E3wWIgD
Take a note of them; we will need them later in this chapter.
Now we need to generate an access token. On the same page, you'll see Your Access Token section that is empty. Click on Create my access token. It creates two pieces of information:
- Access Token; for example,
12736172-R017ah2pE2OCtmi46IAE2n0z3u2DV6IqsEcPa0THR
- Access Token Secret; for example,
4RTJJWIezIDcs5VX1PMVZolXGZG7L3Ez7Iz1gMdZucDaM
Take a note of them too. An access token is unique to you and you should not share it with anyone. Keep it private.
Now we have everything that we need to start using Twitter's Streaming API.
- 黑客攻防從入門到精通(實戰秘笈版)
- C語言程序設計教程
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- Three.js開發指南:基于WebGL和HTML5在網頁上渲染3D圖形和動畫(原書第3版)
- Android 9 Development Cookbook(Third Edition)
- Learn Swift by Building Applications
- OpenShift在企業中的實踐:PaaS DevOps微服務(第2版)
- Python從入門到精通
- QGIS Python Programming Cookbook(Second Edition)
- OpenStack Networking Essentials
- 微課學人工智能Python編程
- OpenCV Android開發實戰
- JavaScript編程精解(原書第2版)
- 透視C#核心技術:系統架構及移動端開發
- JBoss AS 7 Development