Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and The Cloud
by Paul J. Deitel, Harvey M. Deitel
13.13 Twitter Streaming API
Twitter’s free Streaming API sends to your app randomly selected tweets dynamically as they occur—up to a maximum of one percent of the tweets per day. According to InternetLiveStats.com, there are approximately 6000 tweets per second, which is over 500 million tweets per day.23 So the Streaming API gives you access to approximately five million tweets per day. Twitter used to allow free access to 10% of streaming tweets, but this service—called the fire hose—is now available only as a paid service. In this section, we’ll use a class definition and an IPython session to walk through the steps for processing streaming tweets. Note that the code for receiving a tweet stream requires creating a custom class that inherits ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access