Skip to content

Instantly share code, notes, and snippets.

@tako2
Created November 15, 2015 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tako2/35625c5df91d88840719 to your computer and use it in GitHub Desktop.
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.
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