Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Log in. Substitute your own username and password here.
- echo "Logging in..."
- curl --cookie-jar cookies -d username=XXXXX -d password='YYYYY' https://www.newsblur.com/api/login >/dev/null
- PAGE=0
- NUM=1
- while [ $NUM != 0 ]
- do
- echo NUM IS $NUM
- # Download the next page of saved stories.
- PAGE=$(($PAGE + 1))
- echo "Downloading saved stories, page ${PAGE}..."
- curl --cookie cookies https://www.newsblur.com/reader/starred_stories?page=$PAGE > saved-stories.${PAGE}.json
- # Count how many stories we got back (requires http://kmkeen.com/jshon/)
- NUM=`jshon -e stories -l < saved-stories.${PAGE}.json`
- echo $NUM Stories fetched
- done
- # tidy up by removing the last (empty) page of stories, and the cookie jar
- rm -f cookies saved-stories.${PAGE}.json
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement