Skip to content

Tweet Streamer is a script designed to stream and save tweets with specified keywords.

License

Notifications You must be signed in to change notification settings

acantu27/TweetStreamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tweet Streamer

License Version

Tweet Streamer is a script designed to stream and save tweets for data analysis.

Preview:

Tweet Streamer Preview

Introduction

Tweet Streamer is a python script utilizing Twitter's streaming API. It streams live tweets and saves their properties. Tweets are able to be filtered based on desired keywords or languages.

Requirements

  • Please see requirements.txt for the necessary dependencies
  • Requires Python 3+
  • Some features might not be supported such as colored text output

Usage

  1. Clone the repository to the desired location.

  2. Register an account with Twitter to generate your API key.

  3. The setup guide should automatically run the first time. Alternatively you can run tweetstreamer.py -s to relaunch the setup. Or you can manually insert your credentials into the settings.py file.

    Note: All values in the settings.py act as the default values.

CONSUMER_KEY = 'consumer_key_here'
CONSUMER_SECRET = 'consumer_key_here'
ACCESS_TOKEN = 'access_token_here'
ACCESS_SECRET = 'access_secret_here'

Tweet Streamer utilizes command line arguments. See help for more information tweetstreamer.py -h

optional arguments:
  -h, --help            show this help message and exit
  -o [OUTPUT], --output [OUTPUT]
                        Saves tweets as specified file name
  -t, --terse           Disables outputting tweets to console
  -c, --color           Enables colored text in console
  -v VERSION, --version VERSION
                        Displays current version
  -k KEYWORDS [KEYWORDS ...], --keywords KEYWORDS [KEYWORDS ...]
                        Filter tweets by the specified keywords
  -l LANGUAGES [LANGUAGES ...], --language LANGUAGES [LANGUAGES ...]
                        Filter tweets by the specified language.
  -s, --setup           Begins the setup process

A KeyboardInterrupt such as Ctrl + C will stop the stream and close the database if desired.

About

Tweet Streamer is a script designed to stream and save tweets with specified keywords.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages