Skip to content

Instantly share code, notes, and snippets.

@ciarand
Created December 13, 2014 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciarand/b2517f7ac1f8c388a545 to your computer and use it in GitHub Desktop.
Save ciarand/b2517f7ac1f8c388a545 to your computer and use it in GitHub Desktop.
probably extract most of @ciarand's app.net posts (you'll need a token)
#!/bin/sh
curl -q -H "Authorization: Bearer $AUTH_TOKEN" \
"https://api.app.net/posts/search?creator_id=45708&count=200" > tmp.json
while true
do
MIN_ID=$(jq < tmp.json .meta.min_id | sed -e 's/"//g')
jq < tmp.json '.data[].text' | gsed -e 's/^"//' | gsed -e 's/"$//' | gsed -e 's/@\w\+ \?//g' >> ./posts.txt
curl -q -H "Authorization: Bearer $AUTH_TOKEN" \
"https://api.app.net/posts/search?creator_id=45708&count=200&before_id=$MIN_ID" > tmp.json
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment