Skip to content

Instantly share code, notes, and snippets.

@snoj
Created March 22, 2019 18:43
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/a8084780b4b04ddd49abac638800b4b7 to your computer and use it in GitHub Desktop.
Save snoj/a8084780b4b04ddd49abac638800b4b7 to your computer and use it in GitHub Desktop.

requirements

Scripts provided assume that pup and archive.to.sh are in a PATH folder.

do

edit archive-twitter-user.sh for the twitter username watch -n 60 ./archive-twitter-user.sh

#!/bin/bash
tuser="TWITTERUSERNAME";
searchurl="https://twitter.com/search?f=tweets&vertical=default&q=from%3A$tuser&src=typd"
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 "$searchurl" | pup "a[href*=$tuser/status] attr{href}" 2>/dev/null | xargs -I {} archive.to "https://twitter.com{}"
#!/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/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment