mirror of
https://github.com/bellingcat/tiktok-hashtag-analysis.git
synced 2026-06-08 03:18:31 +03:00
04feb1545608a2b7497c17e069a16fa4d9cf243d
TikTok hashtag analysis toolset
The project provides tools to analyze hashtags based on data downloaded using tiktok-scraper (https://github.com/drawrowfly/tiktok-scraper).
Pre-requisites
- Download and install TikTok scraper: https://github.com/drawrowfly/tiktok-scraper
- Download posts relating to a hashtag in the json format. Example: tiktok-scraper hashtag tokyo2021 -t 'json'
extract_date.py
- Use the following command: python3 extract_date.py target_file.json hashtag_name
- The command above uses the extract_date.py script to extract the dates and the corresponding number of hashtag posts for each date that the TikTok scraper retrieves in the '.json' file.
extract_hashtag.py
- Use the following command to print the result on the screen: python3 extract_hashtag.py target_file.json n -d
- Use the following command to plot: python3 extract_hashtag.py target_file.json n -p
- The command above will plot top n hashtag frequencies based on the json file downloaded using tiktok scraper for a given hashtag. Recommendation n < = 10 for easy to read and analyze.
extract_posts.py
- Use the following command: python3 extract_posts.py target_file.json hashtag_names
- The command above pulls out all the posts for the hashtag hashtag_names (enter multiple names with space) from the downloaded tiktok scraper data.
Languages
Python
97%
Shell
2.1%
Dockerfile
0.9%