- React 16 Essentials(Second Edition)
- Artemij Fedosejev Adam Boduch
- 251字
- 2021-07-02 22:25:19
Getting data from the Twitter Streaming API
The data for our React application will come from Twitter. Twitter has a 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 the Application Details form, agree with 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 these; we will need them later in this chapter.
Now we need to generate an access token. On the same page, you'll see the Your Access Token section that is empty. Click on the Create my access token button. It creates two pieces of information:
- Access Token, for example,
12736172-R017ah2pE2OCtmi46IAE2n0z3u2DV6IqsEcPa0THR
- Access Token Secret, for example,
4RTJJWIezIDcs5VX1PMVZolXGZG7L3Ez7Iz1gMdZucDaM
Take a note of these 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.
- Mastering Visual Studio 2017
- ServiceNow Application Development
- Reporting with Visual Studio and Crystal Reports
- Node.js 10實(shí)戰(zhàn)
- Python量化投資指南:基礎(chǔ)、數(shù)據(jù)與實(shí)戰(zhàn)
- QGIS By Example
- C語(yǔ)言程序設(shè)計(jì)教程
- Mastering Python
- Learning iOS Penetration Testing
- SQL Server 2014數(shù)據(jù)庫(kù)設(shè)計(jì)與開(kāi)發(fā)教程(微課版)
- 前端程序員面試筆試真題與解析
- 軟件自動(dòng)化測(cè)試實(shí)戰(zhàn)解析:基于Python3編程語(yǔ)言
- A/B 測(cè)試:創(chuàng)新始于試驗(yàn)
- Unity Certified Programmer:Exam Guide
- Learning Java by Building Android Games