Created
August 26, 2015 04:17
-
-
Save vielmetti/85d5fba07b98e552c912 to your computer and use it in GitHub Desktop.
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/sh | |
curl -s http://www.a2dda.org/map/AADDACount.json | \ | |
jq '.countdata[] | \ | |
{ timestamp: (.timestamp | strptime("%m/%d/%Y %I:%M:%S %p")| mktime | todate), \ | |
facility: .facility, \ | |
spacesavail: (.spacesavail | tonumber) }' | \ | |
mongoimport -d test -c a2dda |
Author
vielmetti
commented
Aug 26, 2015
db.a2dda.aggregate( [ { $group: { _id: "$timestamp", total: { $sum: "$spacesavail" } } }, { $sort: { _id: 1 } } ] )
ok, it's in crontab, let's let it run for a while
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment