LuisBosquez / TwitterGraphFeed

Read a Twitter feed and insert it into Azure Cosmos DB Gremlin API graph!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Azure Cosmos DB Gremlin API + Twitter API: Tweet and Hashtag aggregator

What does it do?

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.

How do I run it?

  1. First create a Cosmos DB graph account.

  2. Create a Twitter API account. You will be provided with a consumer key, consumer secret, access token and access token secret.

  3. Install all the required packages using pip.

    pip install -r requirements.txt
    
  4. Replace your configuration variables in config.py using the values from your Cosmos DB and Twitter API accounts.

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

About

Read a Twitter feed and insert it into Azure Cosmos DB Gremlin API graph!


Languages

Language:Python 100.0%