dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 995c7a1a0ce8b0da687d65eb4079a58897db9a88
parent 0946c4be9b5cb2b763512566d0c5bc19178ea42d
Author: Yuval Langer <yuval.langer@gmail.com>
Date:   Fri,  3 Nov 2023 08:05:29 +0200

Add a script that outputs working nitter instances.

Diffstat:
Abin/get-nitter-instances | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/bin/get-nitter-instances b/bin/get-nitter-instances @@ -0,0 +1,25 @@ +#!/bin/sh + +if [ -z "$(command -v git)" ]; then + printf "Please install git."; + exit 1; +fi + +nitter_wiki_directory="$HOME/.cache/get-nitter-instances" + +do_update="$1" + +(git clone https://github.com/zedeus/nitter.wiki.git "$nitter_wiki_directory" > /dev/null 2>&1 || + (if [ "$do_update" = "--update" ]; then + cd "$nitter_wiki_directory" + git pull -v > /dev/null 2>&1 + fi) +) && + grep white_check_mark "$nitter_wiki_directory/Instances.md" | + grep 'white_check_mark:\s*|\s*:white_check_mark' | + sed " +s#white_check_mark.*##; +s#.*](##; +s#).*##" | + sort -h | + uniq