Giter Site home page Giter Site logo

gotweetdelete's Introduction

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 [email protected]: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

gotweetdelete's People

Contributors

bogosj avatar elgohr avatar jadametz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gotweetdelete's Issues

Support multiple tweet IDs to ignore.

Use case: ignore both my pinned tweet and my Keybase proof tweet.

  • Option 1: Convert IgnoreID into a list of int64 which should allow passing comma separated IDs, and be backwards compatible with existing uses.
    • Pro: Code is less complex.
    • Con: Semantically IgnoreID which supports multiple IDs is a bit weird.
  • Option 2: Add an additional IgnoreIDs value to the config which is a list of int64.
    • Pro: Semantics make sense.
    • Con: More complex code.
  • Option 3: Replace IgnoreID with IgnoreIDs, as described in option 1.
    • Pro: Semantics make sense, and less complex code.
    • Con: Breaks existing usage.

Feature request: Do not deleted pinned tweet.

Hi and thank you for this highly useful software.I don't know if the Twitter API allows for this kind of behavior but it would be really keen if we could keep the pinnned tweet from being deleted even when everything else goes into the trash.

Provide a way to ignore tweets by substring.

Use case: I'd like to tweet to @RemindMe_OfThis and leave those tweets up, so that the bot is able to reply to me in the future. It appears the bot is not able to remind me if it can't reply to the tweet requesting the reminder.

Feature: Ability to define a number of tweets to keep?

Hello, I hope you're doing well. I'm here today with a selfish and possibly vain feature request. I'd like to know if it's possible to define a number of tweets to keep as opposed to number of days? Being as I work in the security industry, I would like to maintain 1337 tweets in my timeline. I'm at 1332 right now. πŸ˜ƒ Silly? Maybe. Juvenile? Probably. Useful? Totally! πŸ‘πŸ» Thanks for listening.

Call to timeline appears to only fetch 200 tweets?

I've tried running using the defaults, as well as with TWEETCOUNT=3000 in my environment, but I consistently get:

time="2020-10-29T23:04:24Z" level=info msg="Starting goTweetDelete run"
time="2020-10-29T23:04:24Z" level=info msg="Tweet evaluation complete" deleted=0 ignored=1 skipped=199
time="2020-10-29T23:04:24Z" level=info msg="Completed goTweetDelete run"

If I run with a much shorter window like DAYSTOKEEP=5 I get:

time="2020-10-29T23:08:22Z" level=info msg="Starting goTweetDelete run"
time="2020-10-29T23:08:33Z" level=info msg="Tweet evaluation complete" deleted=121 ignored=1 skipped=78
time="2020-10-29T23:08:33Z" level=info msg="Completed goTweetDelete run"

Add tests

While project complexity hasn’t grown all that much, it does now include some features. Having tests feel like an ideal next step to ensure things don’t break over time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.