koitaroh / twitter-collection-python

Collect geotagged tweets using Twitter API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

twitter-collection-python

Build Status

Collect tweets using Twitter API and store in MySQL database.

src

file name Description
dump_user_timeline.py dump a user's timeline into csv
TweetCollector.py collect geo-tagged tweets
TweetCollector_ec2.py for launching on EC2 ("_1" and "_2" are for deploying on two different instances)
TweetCollector_keyword.py collect geo-tagged tweets using keyword

Requirements:

  • Python 3
  • tweepy
  • MySQL
  • config.cfg

You'll need a configuration file with twitter API authentication and MySQL connection information. As specified on line 18, make a configuration file "config.cfg" in parent directory. It's a text file. in it, write your twitter API keys and MySQL connection file like below (replace * with your keys).

[twitter]
consumer_key = ****
consumer_secret = ****
access_token_key = ****
access_token_secret = ****

[local_db]
host = ****
user = ****
passwd = ****
db_name = ****

Workflow

  1. Prepare Python and MySQL environment.
  2. Run TweetCollector.py and keep it running.

About

Collect geotagged tweets using Twitter API

License:MIT License


Languages

Language:Python 100.0%