This application reads a Twitter stream based on the provided hashtags, configured under config.py
. Then it creates a graph structure with unique Hashtag vertices that point to all the tweets that contain them.
-
Create a Twitter API account. You will be provided with a consumer key, consumer secret, access token and access token secret.
-
Install all the required packages using pip.
pip install -r requirements.txt
-
Replace your configuration variables in
config.py
using the values from your Cosmos DB and Twitter API accounts. -
Run the
driver.py
file.python .\driver.py
We use Tweepy's Python-based client to access Twitter's service.
To extend the functionality, you can modify the graphListener.py
file to parse the tweets and create custom graph objects using the Gremlin language. A sample response from the Tweepy stream can be found under ./data/sample.json
.