]> git.armaanb.net Git - bin.git/blob - tweet-cgi
Fix small man issues
[bin.git] / tweet-cgi
1 #!/usr/bin/env sh
2 # Grabs a tweet form a user and display it. Avoids using the twitter
3 # API by scrapping a nitter instance, which can easily be scraped,
4 # unlike the intentionally crippled twitter.com. Powers
5 # https://ishaan.bhojwani.org
6
7 INSTANCE=${INSTANCE:-https://nitter.fdn.fr}
8 USER=${USER:-keshinko}
9
10 printf "Content-type: text/plain\n\n"
11 curl -s "$INSTANCE/$USER" | grep tweet-content | head -n 1 \
12                 | sed -e 's/<[^>]*>//g' -e 's/^[ \t]*\(.*$\)/\1/'