Skip to content

Instantly share code, notes, and snippets.

@snoj
Created May 16, 2019 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snoj/0892d0ddbb4ddbe83723e34b16905e75 to your computer and use it in GitHub Desktop.
Save snoj/0892d0ddbb4ddbe83723e34b16905e75 to your computer and use it in GitHub Desktop.
archiving tweets shell scripts
#!/bin/bash
turl="$1"; #`php -r "echo urlencode(\$argv[1]);" "$1"`;
enurl=`php -r "echo urlencode('$turl');"`;
#php -r "echo urlencode(\$argv[1]);" "$1" ; # $turl;
aurl="https://archive.is/?run=1&url=$enurl";
subid=`curl -s "$aurl" | pup 'input[name=submitid] attr{value}'`
subidencoded=`php -r "echo urlencode('$subid');"`;
echo $enurl;
echo $aurl;
echo -F "submitid=$subidencoded" -F "url=$enurl";
##curl -s "" | pup 'input[name=submitid] attt{value}'`
curl -H "Content-Type: application/x-www-form-urlencoded" -vv --referer "$aurl" --data "submitid=$subidencoded&url=$enurl" -s -XPOST "https://archive.is/submit/"
#!/bin/bash
targetuser="shane_holmberg";
curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36" -s "https://twitter.com/search?f=tweets&vertical=default&q=from%3A$targetuser&src=typd" | pup "a[href*=$targetuser/status] attr{href}" 2>/dev/null | xargs -I {} archive.to.sh "https://twitter.com{}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment