Advertisement
Guest User

Untitled

a guest
Feb 11th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Log in. Substitute your own username and password here.
  4. echo "Logging in..."
  5. curl --cookie-jar cookies -d username=XXXXX -d password='YYYYY' https://www.newsblur.com/api/login >/dev/null
  6.  
  7.  
  8. PAGE=0
  9. NUM=1
  10.  
  11. while [ $NUM != 0 ]
  12. do
  13.  
  14. echo NUM IS $NUM
  15. # Download the next page of saved stories.
  16. PAGE=$(($PAGE + 1))
  17. echo "Downloading saved stories, page ${PAGE}..."
  18. curl --cookie cookies https://www.newsblur.com/reader/starred_stories?page=$PAGE > saved-stories.${PAGE}.json
  19.  
  20. # Count how many stories we got back (requires http://kmkeen.com/jshon/)
  21. NUM=`jshon -e stories -l < saved-stories.${PAGE}.json`
  22. echo $NUM Stories fetched
  23. done
  24.  
  25. # tidy up by removing the last (empty) page of stories, and the cookie jar
  26. rm -f cookies saved-stories.${PAGE}.json
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement