helgridly / canonize

a tool for sifting through tweets
0 stars 0 forks source link

canonize

canonize is a tool to help review your tweets, turn them into Writing, and host them on a Jekyll site.

installation

You need Python 3.something and Ruby of some kind.

locally

install:

sudo apt-get install ruby-full build-essential zlib1g-dev
gem install bundler
bundle init
bundle install
pip install -r requirements.txt

There's a decent chance that bundler or jekyll setup will stomp on existing files. If it does, revert their changes.

for local preview:

bundle exec jekyll serve

devcontainer

If you prefer a devcontainer or GitHub codespaces, that works too. For some reason the pip install -r requirements.txt command doesn't work but you can just run it yourself.

running canonize

first time setup

cookies = {
    "auth_token": "XXXX",
    "ct0": "XXXX"
}

These seem to last a long time (weeks?).

parse your tweets and fetch context

This will walk all your tweets and query Twitter for other people's tweets in the conversation.

This takes a while (hours) because Twitter has a ratelimit of 150 requests every 15 minutes.

You can safely Ctrl+C out of the process and it'll pick up where it left off next time you run.

decide which tweets you like

twinder is "tinder for your tweets". Each Twitter thread you've contributed to will be shown to you, and you'll be prompted to keep it or skip it. If you keep it, it'll ask you for an article name and some tags, and will output a markdown file with the thread and some metadata into the drafts/ directory.

canonize is only interested in your tweets, so if other people have posted in the thread after your last tweet, they might not show up in the reviewer. However, twinder prints each tweet's status ID, which you can copy to your browser and stick at the end of twitter.com/any_username/status/<the_id> to look it up.

You can safely Ctrl+C out of the process and it'll pick up where it left off next time you run.

it's up to you from here on out

You now have a drafts/ folder full of Twitter threads. What you want to do with them is up to you!

My process is something like:

the Jekyll site

canonize is designed as a Jekyll site that can be hosted on GitHub Pages.

Place articles in either drafts/ or canon/. Articles in drafts/ will only show up in the explorer if you check the "show drafts" box, and will have a 📝 icon next to them.

The explorer finds these files by checking an index that is generated by running python gen_contents.py. This will create a contents.json file that you should check in along with your article commits.

other notes

If you ever re-download your archive, you can update the tweet .js files in input/ and rerun tweetpile.py. It should Just Work, integrating new tweets into their respective conversations. If you have replied to a thread since last time you reviewed it, that thread should show up for review next time you run twinder.py. But I haven't tested any of this.

development TODOs

next

later

done