Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karan/fleets
Automatically delete tweets, retweets, and favorites.
https://github.com/karan/fleets
cron deleting-tweets fleets retweets twitter-api twitter-bot
Last synced: 5 days ago
JSON representation
Automatically delete tweets, retweets, and favorites.
- Host: GitHub
- URL: https://github.com/karan/fleets
- Owner: karan
- License: apache-2.0
- Created: 2020-06-05T02:58:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-05T15:57:28.000Z (almost 3 years ago)
- Last Synced: 2024-10-26T18:30:09.878Z (17 days ago)
- Topics: cron, deleting-tweets, fleets, retweets, twitter-api, twitter-bot
- Language: Go
- Homepage: https://goel.io/fleets
- Size: 2.89 MB
- Stars: 89
- Watchers: 5
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fleets
*Nothing is forever. Except the Internet.*
Automatically delete tweets, retweets, and favorites.
Heavily based on https://github.com/victoriadrake/ephemeral.
## How it works
Depending on the schedule you set, this bot will:
- Read config file
- Get your timeline
- Delete all tweets older than `MAX_TWEET_AGE`
- Unfavorite tweets older than `MAX_TWEET_AGE`
- (Optional) Ping healthcheck URLsYou can set `DRY_RUN=true` to print all actions it will take instead of actually deleting tweets.
The tool does not take into account Twitter rate limits, but it does sleep for a few seconds between each Twitter API call.
## Setup
Copy and create a `prod.env` from `template.env`. Look at comments for values (then delete the comments).
## Build and Run
### Run
Set `ENV_FILE_PATH` to the file that contains the env vars.
```
$ ENV_FILE_PATH=sandbox.env go run main.go
```## Build
Set `ENV_FILE_PATH` to the file that contains the env vars. Set `GOOS` to your target platform.
```
$ GOOS=linux go build -ldflags="-d -s -w" -o fleets main.go && chmod +x fleets
$ ENV_FILE_PATH=sandbox.env ./fleets
```## Cron
You can use cron to run the script. Example to run it every day at 4pm:
```
DATEVAR=date +%Y-%m-%d
0 16 * * * ENV_FILE_PATH=/home/prod.env /home/fleets >> /home/cron-$($DATEVAR).log 2>&1
```