Created
April 27, 2015 07:54
-
-
Save johnrees/ac5fd13ee8c96fade3af to your computer and use it in GitHub Desktop.
smartcitizen debug table to curl
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
$('table#log_table tr').each(function(index, tr) { | |
var a = $('td', tr).map(function(index, td) { | |
return $(td).text(); | |
}); | |
console.log("curl -v -X POST -H 'Host: sc.dev' -H 'User-Agent: SmartCitizen' -H 'X-SmartCitizenMacADDR: " + a[1] + "' -H 'X-SmartCitizenVersion: "+ a[2]+"' -H 'X-SmartCitizenData: [{\"temp\":\""+a[4]+"\",\"hum\":\""+a[5]+"\",\"light\":\""+a[6]+"\",\"bat\":\""+a[7]+"\",\"panel\":\""+a[8]+"\",\"co\":\""+a[9]+"\",\"no2\":\""+a[10]+"\",\"noise\":\""+a[11]+"\",\"nets\":\""+a[12]+"\",\"debug_push\": 1,\"timestamp\":\""+a[13]+"\"}]' sc.dev/add") | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment