Created
March 9, 2016 16:16
-
-
Save mnp/7acfe6b26d815a9c77a1 to your computer and use it in GitHub Desktop.
export from pushbullet to a pile of json
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 | |
| # see https://docs.pushbullet.com/#list-pushes | |
| mytoken=$1 | |
| n=0 | |
| cursor='' | |
| while true; do | |
| curl --header "Access-Token: $mytoken" \ | |
| --data-urlencode active="true" \ | |
| --data-urlencode modified_after="1" \ | |
| $cursor \ | |
| --get \ | |
| https://api.pushbullet.com/v2/pushes > part${n} | |
| gotcurs=$( jq ".cursor" part${n} | sed s/\"//g ) | |
| if [ $gotcurs == null ]; then | |
| break | |
| fi | |
| sleep 1 | |
| cursor="--data-urlencode cursor=$gotcurs" | |
| n=$[n + 1] | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment