Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
React.js Essentials

You're reading from  React.js Essentials

Product type Book
Published in Aug 2015
Publisher Packt
ISBN-13 9781783551620
Pages 208 pages
Edition 1st Edition
Languages
Author (1):
Artemij Fedosejev Artemij Fedosejev
Profile icon Artemij Fedosejev

Table of Contents (18) Chapters

React.js Essentials
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing Powerful Tools for Your Project 2. Create Your First React Element 3. Create Your First React Component 4. Make Your React Components Reactive 5. Use Your React Components with Another Library 6. Update Your React Components 7. Build Complex React Components 8. Test Your React Application with Jest 9. Supercharge Your React Architecture with Flux 10. Prepare Your React Application for Painless Maintenance with Flux Index

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:

  1. Create a Twitter account. For this, go to https://twitter.com and sign up; or sign in if you already have an account.

  2. 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.

You have been reading a chapter from
React.js Essentials
Published in: Aug 2015 Publisher: Packt ISBN-13: 9781783551620
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}