Skip to content
This repository was archived by the owner on Mar 7, 2023. It is now read-only.
/ twimg Public archive

Browse twitter home timeline by media only

License

Notifications You must be signed in to change notification settings

phortuin/twimg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

bc879de · Mar 7, 2023

History

81 Commits
Jun 2, 2020
May 11, 2021
Jul 7, 2021
Apr 24, 2021
May 11, 2021
May 29, 2020
Apr 14, 2021
May 29, 2020
May 29, 2020
Jul 7, 2021
Jul 7, 2021
Mar 7, 2023
Apr 1, 2021

Repository files navigation

T/W/I/M/G

Browse twitter home timeline by media only

🚧 Abandoned project. I no longer have a Twitter account, for obvious reasons

One-page website that renders tweets from your home timeline that have media attached (image, video). Images shown in a large format, easy to right-click-save or save to Dropbox.

Development

Create and configure .env file, install dependencies and run using vercel dev:

$ cp .env.example .env
$ npm i
$ npm run dev:vercel

Production

Deploy with Vercel. You can set environment variables in your Vercel app with the exact same keys as in the .env file.

Notes

  • Twitter consumer key/secret is gained by creating a Twitter app with your Twitter developer account.
  • Dropbox tokens can be created in a Dropbox app.
  • Sessions are stored in an UpStash Redis Database with TLS encryption.
  • Twitter limits user requests to 15 per 15 minutes. 200 tweets can be retrieved from the API at a time, with a max of 800. The ‘media only’-filtering done in this app will reduce that number further.

Tech

  • Runs on Vercel
  • Templating with Mustache
  • That’s about it

Todo

  • Dropbox oAuth login instead of access token
  • Saving image api endpoint should check for Accept header to return JSON or HTML
  • Write proper unit tests for Dropbox instance
  • Let error handling middleware handle Dropbox errors as well as Twitter
  • Redis instance shouldn’t export initClient
  • Refactor redis-instance to session manager
  • Refactor cookie script and let session be an actual session cookie
  • Update cookie expiry after succesful authentication
  • Lazy loading of images
  • Use smaller image assets for display, larger when saving

License

MIT