svbnet / deleted-tweets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deleted-tweets

a twitter bot that monitors specific twitter account(s) and tweets screenshots of any messages which they subsequently delete

important caveats

  • this is technically breaking the twitter API tos, so be warned your account or API key may get suspended.
  • for the v1.1 standard REST API, tweets over 140 characters don't include the extended_tweet object, which means backfilled tweets over 140 characters won't be rendered properly. this isn't an issue currently for the v1.1 streaming API.
  • "extended tweets" are available on the v1.1 premium and v2 APIs but i haven't had the time to apply for a v2 API key, especially considering the above.

dependencies

  • wkhtmltopdf - in most cases it's best to just download it from here then install it rather than directly through your package manager.
  • Python 3 (>= 3.7) and pip
  • virtualenv

install

  • clone
  • virtualenv venv
  • . venv/bin/activate
  • pip3 install -r requirements.txt

getting up and running

all of these below guides assume you are in an activated virtualenv.

adding your API credentials

  1. create a new Twitter API application, if you haven't done so already, and have the consumer key and secret ready.
  2. run python add_account.py - this creates a data directory relative to where you extracted everything, and adds your config.json file. if you would like to use a different directory, pass the --init-dir <dir> option on this and subsequent commands.
  3. open data/config.json in a text editor and set your consumer keys under the consumer object.

adding an account to post from

  1. run python add_account.py - this will generate an authorization URL you can go to in your browser.
  2. once you have authorized the application, enter the PIN code Twitter gives you into the prompt.

adding accounts to watch

  1. run python add_watcher.py <watcher name> [account names...], where watcher name is the name of the watcher you want to add, followed by the accounts you want to watch.
  2. if the watcher does not exist, you will be prompted to select an account to watch/post from.

Extra options for posting

  • By default, the watcher and poster account IDs are the same. You can specify separate accounts for watchers and posters by specifying a value for poster_account_id in the watcher object.
  • You can also specify a tz name as poster_timezone to offset the timestamps displayed on the tweet renderings.

Custom fonts

If you are running it on Linux the rendered output will probably use Bitstream Vera or whatever wkhtmltoimage uses as its default sans serif font. Since you probably won't want this, you can configure a custom font to use.

Helvetica

Chirp (the new font)

About

License:GNU General Public License v2.0


Languages

Language:Python 89.5%Language:HTML 9.8%Language:CSS 0.7%