Coder Social home page Coder Social logo

jandedobbeleer / ephemeral-serverless Goto Github PK

View Code? Open in Web Editor NEW

This project forked from victoriadrake/ephemeral

5.0 2.0 0.0 50 KB

Automatically delete your old Tweets with AWS Lambda

License: GNU Affero General Public License v3.0

Go 96.73% PowerShell 3.27%

ephemeral-serverless's Introduction

ephemeral-serverless: automatically delete your old Tweets with AWS Lambda

ephemeral is a Twitter timeline grooming program that runs for pretty much free on AWS Lambda. The code is forked from Vicky Lai's excellent ephemeral Lambda, and extended to use serverless for deployments.

You can use ephemeral-serverless to automatically delete all tweets from your timeline that are older than a certain number of hours that you can choose. For instance, you can ensure that your tweets are deleted after one week (168h), or one day (24h).

The program will run once for each execution based on the trigger/schedule you set in serverless.yml. It will delete up to 200 expired tweets (per-request limit set by Twitter's API) each run.

Twitter API

You will need to create a new Twitter application and generate API keys. The program assumes the following environment variables are set using ssm (except for MAX_TWEET_AGE):

TWITTER_CONSUMER_KEY
TWITTER_CONSUMER_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_TOKEN_SECRET
MAX_TWEET_AGE

MAX_TWEET_AGE expects a value of hours, such as: MAX_TWEET_AGE = 72h

Optionally, you can whitelist certain tweets and save them from deletion by setting the variable WHITELIST with the tweet's ID as the value. Find the ID as the string of numbers at the end of the tweet's URL, for example:

https://twitter.com/jandedobbeleer/status/1101422074718011392

Set one ID to whitelist, or multiple IDs using the separator : like so:

WHITELIST = 1101422074718011392:1052942396034609152

build.ps1

This handy script is included to help you build and deploy your function code using PowerShell.

License

Copyright (C) 2018-2019 Vicky Lai

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

ephemeral-serverless's People

Contributors

adamdrake avatar jandedobbeleer avatar sw00 avatar yeled avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.