Skip to content

Instantly share code, notes, and snippets.

@pauladam
Last active January 24, 2017 01:24
Show Gist options
  • Save pauladam/ef988fcc09ddcb4c9738e610142bb7de to your computer and use it in GitHub Desktop.
Save pauladam/ef988fcc09ddcb4c9738e610142bb7de to your computer and use it in GitHub Desktop.
# for i in `seq 0 25 150`; do curl "https://api/rest/api/latest/projects/YIELD/repos/ciapi/pull-requests?avatarSize=64&order=newest&state=ALL&start=$i" -H 'Cookie: v2regbstage=true; wrt=1068582_50nolg6irase14s09bodq42oba; _ga=GA1.2.1077262358.1469463862; _atl_bitbucket_remember_me=cookie; JSESSIONID=cookie' -H 'DNT: 1' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: en-US,en;q=0.8' -H 'X-AUSERNAME: phowe' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: https://api/projects/YIELD/repos/ciapi/pull-requests?state=ALL' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'X-AUSERID: 1311' --compressed | jq '.' ; done
# Have
{
"start": 0,
"limit": 25
}
{
"start": 25,
"limit": 25
}
# Want
{
"start": 0,
"limit": 25
},
{
"start": 25,
"limit": 25
}
...
@pauladam
Copy link
Author

bash-3.2$ X=""; echo "["; for i in `seq 0 25 150`; do res=`curl -s 'https://jsonip.com/' | jq '.'`; x=",";  echo -ne "$res$x" ; done ; echo "]"
[
{
  "ip": "2620:106:e00f:f167::13",
  "about": "/about",
  "Pro!": "http://getjsonip.com"
},{
  "ip": "2620:106:e00f:f167::13",
  "about": "/about",
  "Pro!": "http://getjsonip.com"
},{
  "ip": "2620:106:e00f:f167::13",
  "about": "/about",
  "Pro!": "http://getjsonip.com"
},{
  "ip": "2620:106:e00f:f167::13",
  "about": "/about",
  "Pro!": "http://getjsonip.com"
},{
  "ip": "2620:106:e00f:f167::13",
  "about": "/about",
  "Pro!": "http://getjsonip.com"
},{
  "ip": "2620:106:e00f:f167::13",
  "about": "/about",
  "Pro!": "http://getjsonip.com"
},{
  "ip": "2620:106:e00f:f167::13",
  "about": "/about",
  "Pro!": "http://getjsonip.com"
},]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment