Skip to content

Instantly share code, notes, and snippets.

@Sharafi7
Sharafi7 / twsav.bash
Last active September 28, 2019 02:25
“TwSavage” – Save tweets into the Wayback Machine! [reloaded]
# TwSav (or “Twarrior”, or “TwBeast”, or “Tweast”, or “TwSavage”) – Save relevant tweets of users into the Wayback Machine!
# Feel free to suggest improvements in the comments!
# Features coming soon: Archive the profile itself and twitter searches: “from:@username”, “to:@username” using both “top tweets” and chronological search results. All of them have the “&lang=en” URL parameter at the end.
#Declaring common functions and aliasses first:
function errchc { if [ $? -eq 0 ];then printf " \e[102m\e[30m${1:-" "}\e[0m";else printf " \e[101m${1:-" "}\e[0m";fi ;}
d8tm() { date +%Y%m%d%H%M%S ;}
alias ŋrep=grep
alias $(printf "\x66\x75\x63\x6b\x69\x6e\x67")=sudo
2wb() { wget -q -O /dev/null -a 2wb.debug.log -p web.archive.org/save/"$@" ;} # to wayback
@Sharafi7
Sharafi7 / chwb.bash
Last active November 6, 2019 16:48
chwb.bash – The sophisticated YouTube channel subpage archival script.
# chwb.bash – The sophisticated YouTube channel subpage archival script.
# Combatting the 2013 YouTube “One” channel layout. Save entire YouTube profiles into the Wayback Machine, using chwb.bash!
# “chwb” means “channel [to] Wayback”.
# Simplify saving YouTube channel frame information into the Wayback Machine!
# This script is portable. You can copy-paste it right into your terminal.
# Automatically saves all tabs (pages) from a YouTube channel, and videos/playlists/channels sorted in all 6 possible ways into the Wayback Machine for maximum efficient informational preservation.
# Useful if someone in the future wants to depict a deleted channel.
# Idea source: YouTube's 2013-debuted multi-page channel layout makes the Wayback Machine miss out on a lot of information.
# Format: chwb [channel/user URL (full URL)]
@Sharafi7
Sharafi7 / QuickArchiver.sh
Last active September 15, 2019 13:38
Quick webpage archiver – Simply save to Wayback Machine.
function d8tm() { date +%Y%m%d%H%M%S ;} # %N is unsupported on legacy systems.
function qa() { ( wget -a qa.log -O "dev/null" "web.archive.org/record/"'$@' #|wc # Quick and simple command-line Wayback Archiver # You are encouraged to adapt it to your own preferences. # Changed to “wget”, because “curl” does not download images, only text.
if [ $? -ne 0 ];then echo -e "\e[31mArchival error.\e[0m";fi
echo "$(d8tm) QA: $@">>QuickArchiver.log )& # Apparently, error-checking only works with “wget”, which I actually used more commonly. But Android Terminal never had “wget”.
}
# Also works on Android 5.0 or earlier, because /system/bin/curl has been removed and is no longer precluded since Android 6 Marshmallow.
read -p 'Try QuickArchiver out now!:' TryOut_QuickArchiver
qa "$TryOut_QuickArchiver"
echo -e "Well done! Now, you can archive more pages using the \"qa\" command."