/Tweetmetric

Leverage Twitter API v2 to analyze tweet metrics such as impressions and profile clicks over time.

Primary LanguagePythonApache License 2.0Apache-2.0

Tweetmetric

Tweetmetric allows you to track various metrics on your most recent tweets, such as impressions, retweets and clicks on your profile.

example image

The code is in Python, and the frontend uses Dash (a Plotly web interface). Tweetmetric uses Redis as a fast database.

Docker images

You'll find ready to use images on docker hub:

Docker images are built and updated from a mirror repo.

Demo

You can access a demo here based on @MathisHammel's tweets.

Connect to Twitter

Tweetmetric uses private metrics that can only be accessed by the Tweet's owner. You need to provide your API keys to the program so it can work.

Getting started

Standalone setup

  • Store the Twitter secrets in their corresponding environment variables (variable names are in the src/api_secrets.py file)
  • Run cd src; ./launch.sh

Using Docker

Install docker and docker-compose.

If you're on windows or mac, you can use Docker Desktop and use docker-compose instead of docker compose.

$ cp .env.dist .env
# replace all the variables in the .env file
$ docker-compose up -d

Store your Twitter secrets in their corresponding strings inside a .env file (you can create it from the .env.dist example)

Note: you can pick only the docker-compose file and create your .env file without having to clone this git repository.

Contributions

If you have to add a python dependency in order to patch or add some features, please update requirements.txt accordingly.

If you need to rebuild the images because you made some changes:

$ docker-compose up -d --build