Created
November 15, 2015 06:12
-
-
Save tako2/35625c5df91d88840719 to your computer and use it in GitHub Desktop.
node.js script for getting list of images with THETA S API. it needs "request" module.
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
var request = require('request'); | |
var options = { | |
uri: 'http://192.168.1.1/osc/commands/execute', | |
headers: { 'Content-Type': 'application/json;charset=utf-8' }, | |
json: true, | |
keepAlive: false, | |
body: { "name": "camera.listImages", | |
"parameters": { | |
"entryCount": 100, | |
"maxSize": 160, | |
"includeThumb": false } | |
} | |
}; | |
request.post(options, function(err, res, body) { | |
if (err) { | |
console.log(err); | |
return; | |
} | |
if (res.statusCode == 200) { | |
console.log('TOTAL: ' + body.results.totalEntries); | |
console.log(body.results.entries); | |
} else { | |
console.log('Connection Failure... (%d)', res.statusCode); | |
console.log(body); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment