Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/x0rz/tweets_analyzer
Tweets metadata scraper & activity analyzer
https://github.com/x0rz/tweets_analyzer
analysis privacy python twitter
Last synced: 6 days ago
JSON representation
Tweets metadata scraper & activity analyzer
- Host: GitHub
- URL: https://github.com/x0rz/tweets_analyzer
- Owner: x0rz
- License: gpl-3.0
- Created: 2017-01-24T16:56:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-14T07:28:22.000Z (about 1 year ago)
- Last Synced: 2024-11-28T22:02:02.381Z (13 days ago)
- Topics: analysis, privacy, python, twitter
- Language: Python
- Homepage:
- Size: 62.5 KB
- Stars: 2,957
- Watchers: 127
- Forks: 454
- Open Issues: 39
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-hacking-lists - x0rz/tweets_analyzer - Tweets metadata scraper & activity analyzer (Python)
- project-awesome - x0rz/tweets_analyzer - Tweets metadata scraper & activity analyzer (Python)
README
# 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/languagesThere 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](https://pipenv.kennethreitz.org/en/latest/) installed you can just run:
```sh
$ pipenv install
```Otherwise you can use:
```sh
$ pip install -r requirements.txt
```### Usage
```
usage: tweets_analyzer.py -n [options]Simple Twitter Profile Analyzer
optional arguments:
-h, --help show this help message and exit
-l N, --limit N limit the number of tweets to retreive (default=1000)
-n screen_name, --name screen_name
target screen_name
-f FILTER, --filter FILTER
filter by source (ex. -f android will get android
tweets only)
--no-timezone removes the timezone auto-adjustment (default is UTC)
--utc-offset UTC_OFFSET
manually apply a timezone offset (in seconds)
--friends will perform quick friends analysis based on lang and
timezone (rate limit = 15 requests)
-e path/to/file, --export path/to/file
exports results to file
-j, --json outputs json
-s, --save saves tweets to tweets/{twitter_handle}/{yyyy-mm-
dd_HH-MM-SS}.json
--no-color disables colored output
--no-retweets does not evaluate retweets
```### Example output
![Twitter account activity](https://cdn-images-1.medium.com/max/800/1*KuhfDr_2bOJ7CPOzVXnwLA.png)
License
----
GNU GPLv3If this tool has been useful for you, feel free to thank me by buying me a coffee
[![Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoff.ee/x0rz)