Introduction
It's fairly easy to first collect data and then analyze it later. However, doing both steps together may be necessary for some tasks. The gratifying nature of analyzing data the moment it is received is the core subject of this chapter. We will cover how to manage real-time data input from Twitter tweets, Internet Relay Chat (IRC), web servers, file-change notifications, sockets, and webcams.
The first three recipes will focus on dealing with real-time data from Twitter. These topics will include streaming posts by users as well as posts related to keywords.
Next, we will use two separate libraries to interact with IRC servers. The first recipe will demonstrate how to join an IRC chat room and start listening for messages, and the next recipe will show us how to listen for direct messages on an IRC server.
If real-time data is not supported, a common fallback is to query for that data often. This process is calling polling, and we will learn a quick way to poll a web server...