Created
February 9, 2015 18:29
-
-
Save jmorahan/56665898413fbb45212f to your computer and use it in GitHub Desktop.
NewsBlur saved stories download
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Log in. Substitute your own username and password here. | |
echo "Logging in..." | |
curl --cookie-jar cookies -d username=somebody -d password='secret' https://www.newsblur.com/api/login >/dev/null | |
PAGE=0 | |
while | |
# 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/) | |
(($(jshon -e stories -l < saved-stories.${PAGE}.json))) | |
do :; done | |
# tidy up by removing the last (empty) page of stories, and the cookie jar | |
rm -f cookies saved-stories.${PAGE}.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment