Skip to content

Delete Tweets older than X days old

License

Notifications You must be signed in to change notification settings

jadametz/goTweetDelete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b048169 · Dec 16, 2023

History

43 Commits
Dec 16, 2023
Dec 23, 2020
Dec 23, 2020
Jan 10, 2020
Jan 13, 2020
Jan 5, 2021
Jan 10, 2020
Jan 10, 2020
Dec 23, 2020
Jan 10, 2020
Jan 13, 2020
Jan 13, 2020
Sep 1, 2020

Repository files navigation

goTweetDelete

goTweetDelete deletes old Tweets after X (30 by default) days.

Getting Started

goTweetDelete authorizes as you and therefore requires you to have access to the Twitter API.

Configuration

The following environment variables exist for configuration:

Variable Description Required Default
ACCESSSECRET Twitter API credential Y
ACCESSTOKEN Twitter API credential Y
CONSUMERKEY Twitter API credential Y
CONSUMERSECRET Twitter API credential Y
DAYSTOKEEP The number of days to keep Tweets before they're deleted N 30
IGNOREIDS The Tweet ID(s), comma separated, of a Tweet you'd like to be ignored (e.g. a pinned Tweet) N
IGNORESUBSTRINGS Strings, comma separated, that will cause a Tweet to be ignored N
INCLUDERETWEETS Whether RT's should be included in the search/deletion N true
SCREENNAME Your Twitter handle Y

Running the app

Go

Note: Golang 1.13 was used for development. No other version has been tested at this time.

# clone this repository
$ git clone git@github.com:jadametz/goTweetDelete.git
$ cd goTweetDelete

# build the app
$ go build

# export all of the necessary configuration
# e.g.
# export ACCESSSECRET=foo
# export ACCESSTOKEN=bar

# run the app!
$ ./goTweetDelete

Docker

$ docker run --name gotweetdelete \
  --rm \
  -e ACCESSSECRET=... \
  -e ACCESSTOKEN=... \
  -e CONSUMERKEY=... \
  -e CONSUMERSECRET=... \
  -e SCREENNAME=... \
  jadametz/gotweetdelete

docker-compose

A docker-compose.yml is provided for ease of use and assumes that .env exists with the necessary variables.

$ docker-compose up