/NetTweet

Generate a network of connections from a group of Twitter accounts

Primary LanguagePythonMIT LicenseMIT

NetTweet

Generate a network of connections from a group of Twitter accounts. You can specify a group of Twitter accounts and NetTweet adds these accounts to the dataset as well as the accounts followed by them. Then, it selects the account that is followed by the most nodes in the network and adds its following accounts to the dataset. This process will be repeated until it adds all nodes in the network to the dataset (This, however, rarely happens as a network generated by a few nodes can quickly become massive. So you should stop the run whenever you feel satisfied with the size of the network).

Besides the accounts, NetTweet also adds recent tweets of each node to the dataset so you can search through all tweets for specific keywords

How to use

  • Set up a Twitter Developer account (https://developer.twitter.com/)
  • Request an Elevated API access
  • Set up a MongoDB Database
  • Make a config.ini file (use example_config.ini)
  • Select the origin nodes of the network by adding your desired accounts to the config file (use csv format)
  • run add_origins.py
  • run add_nodes.py. All accounts and their tweets will be added to the dataset
  • You can use search_tweets.py to search for tweets with specific keywords (set keywords in the config file)
  • Use add_tweets.py to update the tweets dataset