A series of scripts to archive metadata and medias of your Twitter Favorites(Likes).
Register an App on Twitter Developer and get access credentials in the "Keys and Tokens" tab of your App's page.
Rename docker/config-example.env
to docker/config.env
and customize it with:
- Twitter API credentials
- Your username
- [optional] Cron job schedule(for "Cron job" section)
- Other docker ENV variables.
docker run --rm --name=tfa --env-file=./docker/config.env -v ${PWD}/output:/app/output 15cm/twitter-favorites-archive /app/scripts/main.sh -tdmu -o /app/output -c /app/output/cache.txt
Rename docker/docker-compose-example.yaml
to docker/docker-compose.yaml
and
customize it with the mount point of app-output
volume.
cd
into docker
folder and run:
docker-compose up -d
Run gem install bundler && bundle install
to install Ruby dependencies.
Rename src/config-example.yaml
to src/config.yaml
and fill it with your:
- Twitter API credentials
- Username
You can also run ruby src/twitter-favorites-archive.rb init [args...]
to generate
src/config.yaml
.
- Run
ruby src/twitter-favorites-archive.rb meta
. It will dumps meta data of your favorite tweets underoutput/year/month/tweet_id/tweet.json
. - [Optional] Run
scripts/00-download-all-medias.sh output
. It will download all media(jpeg of photos and video thumbnail) files oftweet.json
to the same folder. - [Optional] Run
scripts/01-update-all-medias-meta.sh output
. It will fetch meta data fromtweet.json
and populate Exif data of the downloaded media files.
To run all the steps together with data dumped to output/
, run scripts/archive.sh output
I import the media files gathered by this project into PhotoPrism so that I can browse images of my Twitter Favorites in a more flexible way.