SHARE
TWEET

Untitled

Nickster258 May 31st, 2016 (edited) 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. COUNTER=0
  3. while [ $COUNTER -lt 1687 ]
  4. do
  5.         COUNTER=$((COUNTER+1))
  6.         rm info.0.json data.txt
  7.         access_token=DUHIWONTBEGIVINGYOUTHIS
  8.         wget -q http://xkcd.com/$COUNTER/info.0.json && python -m -json.tool info.0.json > data.txt
  9.         title=`grep -o -P '(?<=safe_title": ").*(?=",)' data.txt`
  10.         image_url=`grep -o -P '(?<=img": ").*(?=",)' data.txt`
  11.         curl --silent -k --data "board=354658608094837687&note=$COUNTER - $title&image_url=$image_url&link=http://xkcd.com/$COUNTER/" https://api.pinterest.com/v1/pins/?access_token=$access_token > /dev/null
  12.         sleep 4
  13. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top