From 7dc70aa950061a9130ee815e3e3497c9658ec16a Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Sun, 10 Mar 2024 13:24:57 +0000 Subject: [PATCH] Nitter is not dead post --- posts/nitter-is-not-dead.org | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 posts/nitter-is-not-dead.org diff --git a/posts/nitter-is-not-dead.org b/posts/nitter-is-not-dead.org new file mode 100644 index 0000000..5b2299b --- /dev/null +++ b/posts/nitter-is-not-dead.org @@ -0,0 +1,36 @@ +#+title: Nitter is Not Dead +#+date: 2024-03-10 + +A quick one for you all today. + +The maintainer of Nitter said, not long ago, that [[https://github.com/zedeus/nitter/issues/1155#issuecomment-1913361757]["Nitter is dead."]]. This isn't totally inaccurate, as Twitter/X has shut down huge swaths of their public API, especially ones Nitter relied on, making it very, very difficult to properly run a public instance. But private instances are still viable with a bit of tinkering. + +The first step is cloning down the Nitter source code using Git. You'll then need to checkout the =guest_accounts= branch, and optionally build the Docker image for it. The important piece is ensuring you're running that branch's code wherever you're deploying. + +Next, you'll need some tokens to feed into Nitter. Thankfully, someone has already written some Python to do this for us, which you can find [[https://github.com/zedeus/nitter/issues/983#issuecomment-1914616663][here]]. Fill out the username and password, then run it. This will return a few JSON payloads, but the one you want is at the very end (you will also want to convert the single quotes to double quotes). Create a new file alongside your =nitter.conf= file named =guest_accounts.json= with the JSON in an array: + +#+begin_src json +[ + { + "user": { + "id": 123, + "id_str": "...", + "name": "...", + "screen_name": "..." + }, + "next_link": { + "link_type": "subtask", + "link_id": "next_link", + "subtask_id": "SuccessExit" + }, + "oauth_token": "...", + "oauth_token_secret": "...", + "known_device_token": "...", + "attribution_event": "login" + } +] +#+end_src + +Finally, run Nitter! Make sure you have a Redis instance setup for it for caching, and you should be good to go. You can add as many accounts to the =guest_accounts.json= file as you need, which Nitter will cycle through as needed to spread out the requests and rate limiting. Using a proxy is probably also recommended, but it's likely Twitter/X is blocking many of those at this point. + +I expect Twitter/X to eventually crack down further on this, but for the time being we can continue to enjoy the nicer and more privacy concious interface Nitter provides.