Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ID='5f9f61c9389f1af859e15be1'
- JWT_TOKEN='' # optional
- LIMIT=100
- get() {
- curl -s \
- -XGET \
- --url "https://api.streamelements.com/kappa/v2/songrequest/$ID/history?limit=$LIMIT&offset=$1" \
- -H 'Accept: application/json'
- # -H "Authorization: Bearer $JWT_TOKEN"
- }
- main() {
- firstpage=$(get 0)
- total=$(echo "$firstpage" | jq '.total')
- sleep 1s
- {
- echo "$firstpage"
- for i in $(seq 100 100 "$total"); do
- echo >&2 "getting $i/$total"
- get "$i"
- sleep 1s
- done
- } | jq -sc '[.[].history|.[]]'
- }
- main "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement