Geolocation Twitter
README.md
Todo
- Thread twitter save?
- Webbinterface
How to setup environment
- Set these environment variables
TWITTER_CONSUMER_KEY
TWITTER_CONSUMER_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_TOKEN_SECRET
- Install PostgreSQL
- Setup database
$ bash database/setup.sh
- Install python dependencies
$ pip3 install virtualenv && virtualenv env && source env/bin/activate && pip3 install -r requirements.txt
- Start datamining using your filters
bash /startup/init.sh start <filter 1> <filter 2> ...
- Check which filters actually allowed by twitter
bash /startup/init.sh status
- When done, stop the processes with.
bash /startup/init.sh stop
Antaganden Twitters API
- retweeted_id --> tweeten är en retweet
- in_reply_to_user_id --> någon har blivit mentioned
- in_reply_to_status_id --> tweeten är ett svar på en annan tweet
- original_tweet_retweet_count --> finns bara på kommenterade retweets
- En retweet är en "ren" retweet om attributet "original_tweet_retweet_count" inte är null
- En retweet är en "kommenterad" retweet om attributet "original_tweet_retweet_count" är null
Statements för att hämta ut statistik
SELECT count(*) FROM tweets WHERE retweeted_id IS NOT NULL AND in_reply_to_status_id IS NOT NULL AND in_reply_to_user_id IS NOT NULL;
SELECT count() FROM tweets WHERE retweeted_id IS NOT NULL AND in_reply_to_status_id IS NOT NULL AND in_reply_to_user_id IS NULL; SELECT count() FROM tweets WHERE retweeted_id IS NOT NULL AND in_reply_to_status_id IS NULL AND in_reply_to_user_id IS NOT NULL; SELECT count(*) FROM tweets WHERE retweeted_id IS NOT NULL AND in_reply_to_status_id IS NULL AND in_reply_to_user_id IS NULL;
SELECT count() FROM tweets WHERE retweeted_id IS NULL AND in_reply_to_status_id IS NOT NULL AND in_reply_to_user_id IS NOT NULL; SELECT count() FROM tweets WHERE retweeted_id IS NULL AND in_reply_to_status_id IS NOT NULL AND in_reply_to_user_id IS NULL; SELECT count() FROM tweets WHERE retweeted_id IS NULL AND in_reply_to_status_id IS NULL AND in_reply_to_user_id IS NOT NULL; SELECT count() FROM tweets WHERE retweeted_id IS NULL AND in_reply_to_status_id IS NULL AND in_reply_to_user_id IS NULL;
SELECT ALL FILTERED LOCATIONS:
select user_location, name, ratio, country_code from users inner join filtered_user_locations using (user_id) inner join geonames using(geonameid);