项目作者: kmario23

项目描述 :
Model & analysis of tweet hops network in Twitter
高级语言: Python
项目地址: git://github.com/kmario23/tweethops.git
创建时间: 2016-02-02T01:41:46Z
项目社区:https://github.com/kmario23/tweethops

开源协议:

下载


1) To run the code, get the access tokens & keys from twitter-application

2) To stream realtime tweets

  1. time python twitter_streaming.py > ../data/twitter_stream.txt

Rarely it may throw an error. Don’t fret.
It simply means that our network is not fast enough to collect/fetch the data that twitter server is sending.

3) For custom query: ‘to’ date should be current day to get the full tweets
  1. python fetch_stale_tweets.py -q "mars mission" -o "data/results.txt" -cnt 100 \
  2. -from "2015-12-31" -to "2016-11-11"
4) Plot the statistics
  1. python scatterPlotUserStatistics.py -i ../data/user_statistics.txt
5) Group the data points into the respective grids and assign group IDs
  1. python scatterPlot_groupAssign.py -i ../data/user_statistics_mars-mission.txt
6) Run hop-algorithm implementation
  1. time python complete_hop_algorithm.py -q "mars mission" -cnt 10000 -thresh 50000 \
  2. -from "2015-12-31" -to "2016-11-25" -o all_results.txt

This last step alone is enough to see the result of tweet hops from group to group.

PS: Graph plotting code is yet to be added.