Twitter Streaming Data  

Hi every one, This time I'll explain you how to gather twitter's Data in real-time.

If you remember, in the last article I showed you how to scrape data from Twitter in batch mode, and I explained you how to create a twitter APP.
So I invite you to read this article before starting this one because, you should have created your twitter App.
Now, That you have created you App. You can begin gathering data in streaming. ie. That you will capture the data at the moment of it's posting in twitter. 

In our case, I will use Python 2.7, so we should install the library: tweepy
Pip install tweepy

If we want to store data into CSV file:
The detailed code is published in: https://github.com/dihiaselma/Tweeter/blob/master/Tweeter_Stream_CSV.py  and it contains the explanation
In the code, you should paste the access token and keys that you get from your Twitter app above.

If we want to store data into Hbase database:
Hbase is a NoSQL columns oriented distributed database. It is open source, developed as part of Apache Software Foundation's Apache Hadoop project and runs on top of HDFS (Hadoop Distributed File System).
Its structure consists on creating a namespace, containing tables. Each row is a column-value.
The detailed code is published in: https://github.com/dihiaselma/Tweeter/blob/master/Twitter_Stream_Hbase.py  and it contains the explanation
In the code, you should paste the access token and keys that you get from your Twitter app above.

Good luck :) 


  







Comments

Popular posts from this blog