Skip to content

Instantly share code, notes, and snippets.

@localshred
Created July 21, 2014 17:46
Show Gist options
  • Save localshred/1986d1816af28c7cf42f to your computer and use it in GitHub Desktop.
Save localshred/1986d1816af28c7cf42f to your computer and use it in GitHub Desktop.
jq is the bomb.com
{"results":[{"timePeriod":"201406100000","count":0},{"timePeriod":"201406110000","count":0},{"timePeriod":"201406120000","count":0},{"timePeriod":"201406130000","count":0},{"timePeriod":"201406140000","count":0},{"timePeriod":"201406150000","count":0},{"timePeriod":"201406160000","count":0},{"timePeriod":"201406170000","count":0},{"timePeriod":"201406180000","count":0},{"timePeriod":"201406190000","count":27},{"timePeriod":"201406200000","count":26},{"timePeriod":"201406210000","count":35},{"timePeriod":"201406220000","count":3},{"timePeriod":"201406230000","count":6},{"timePeriod":"201406240000","count":14},{"timePeriod":"201406250000","count":9},{"timePeriod":"201406260000","count":37},{"timePeriod":"201406270000","count":32},{"timePeriod":"201406280000","count":10},{"timePeriod":"201406290000","count":8},{"timePeriod":"201406300000","count":44},{"timePeriod":"201407010000","count":47},{"timePeriod":"201407020000","count":52},{"timePeriod":"201407030000","count":920},{"timePeriod":"201407040000","count":89},{"timePeriod":"201407050000","count":67},{"timePeriod":"201407060000","count":34},{"timePeriod":"201407070000","count":836},{"timePeriod":"201407080000","count":722},{"timePeriod":"201407090000","count":1023},{"timePeriod":"201407100000","count":1821},{"timePeriod":"201407110000","count":16696},{"timePeriod":"201407120000","count":2769},{"timePeriod":"201407130000","count":1153},{"timePeriod":"201407140000","count":461},{"timePeriod":"201407150000","count":1071},{"timePeriod":"201407160000","count":155},{"timePeriod":"201407170000","count":49},{"timePeriod":"201407180000","count":44},{"timePeriod":"201407190000","count":9}]}
# Download a list of counts per day from gnip
$ curl ... > counts.json
# Map the count field into the add filter with jq
# http://stedolan.github.io/jq/manual/#add
$ jq 'map(.[] | .count) | add' counts.json
28269
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment