Created
July 3, 2012 17:58
-
-
Save rooreynolds/3041389 to your computer and use it in GitHub Desktop.
Things - publish number or items completed and created today to Cosm
This file contains 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
# get simple CSV showing number of items completed and created today | |
sqlite3 -csv ~/Library/Application\ Support/Cultured\ Code/Things\ beta/ThingsLibrary.db "SELECT | |
'completed', case when count then count else '0' end from (SELECT date(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime') as date, | |
count(Z_PK) as count from ZTHING WHERE ZSTATUS = 3 and date = (SELECT date('now'))); | |
SELECT 'created', case when count then count else '0' end from (SELECT date(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime') as date, | |
count(Z_PK) as count FROM ZTHING WHERE ZCREATIONDATE != '' and date = (SELECT date('now')));" |
This file contains 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
# posts things stats (via ./get_completed_and_created.sh) to Cosm | |
curl --request PUT \ | |
--data-binary "`./get_completed_and_created.sh`" \ | |
--header "X-ApiKey: YOUR_COSM_API_KEY" \ | |
--verbose \ | |
http://api.cosm.com/v2/feeds/YOUR_COSM_API_KEY.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment