项目作者: x0rz

项目描述 :
推文元数据抓取器和活动分析器
高级语言: Python
项目地址: git://github.com/x0rz/tweets_analyzer.git
创建时间: 2017-01-24T16:56:12Z
项目社区:https://github.com/x0rz/tweets_analyzer

开源协议:GNU General Public License v3.0

关键词:
python privacy twitter analysis

下载


Simple Twitter Profile Analyzer

The goal of this simple python script is to analyze a Twitter profile through its tweets by detecting:

  • Average tweet activity, by hour and by day of the week
  • Timezone and language set for the Twitter interface
  • Sources used (mobile application, web browser, …)
  • Geolocations
  • Most used hashtags, most retweeted users and most mentioned users
  • Friends analysis based on most frequent timezones/languages

There are plenty of things that could be added to the script, feel free to contribute! 👍

Installation

⚠ First, update your API keys in the secrets.py file. To get API keys go to https://apps.twitter.com/

Python v2.7 or newer is required

You will need the following python packages installed: tweepy, ascii_graph, tqdm, numpy

If you have pipenv installed you can just run:

  1. $ pipenv install

Otherwise you can use:

  1. $ pip install -r requirements.txt

Usage

  1. usage: tweets_analyzer.py -n <screen_name> [options]
  2. Simple Twitter Profile Analyzer
  3. optional arguments:
  4. -h, --help show this help message and exit
  5. -l N, --limit N limit the number of tweets to retreive (default=1000)
  6. -n screen_name, --name screen_name
  7. target screen_name
  8. -f FILTER, --filter FILTER
  9. filter by source (ex. -f android will get android
  10. tweets only)
  11. --no-timezone removes the timezone auto-adjustment (default is UTC)
  12. --utc-offset UTC_OFFSET
  13. manually apply a timezone offset (in seconds)
  14. --friends will perform quick friends analysis based on lang and
  15. timezone (rate limit = 15 requests)
  16. -e path/to/file, --export path/to/file
  17. exports results to file
  18. -j, --json outputs json
  19. -s, --save saves tweets to tweets/{twitter_handle}/{yyyy-mm-
  20. dd_HH-MM-SS}.json
  21. --no-color disables colored output
  22. --no-retweets does not evaluate retweets

Example output

Twitter account activity

License

GNU GPLv3

If this tool has been useful for you, feel free to thank me by buying me a coffee

Coffee