Install with npm:
npm install --save git+ssh://git@github.com/blairanderson/httppole.git
var httppole = require('httppole');
var client = httppole.createClient({
endpoint: 'localhost:4000' // endpoint of your edison screen
});
client.weather('98034', callback);
//=> screen updated with forecast!!!
// => callback on screen update error/success
include jquery.httppole.js
add your endpoint
$.httppole.setEndpoint("localhost:3000")
$.httppole.weather("98034", callback);
Requirement: client requires an endpoint. An error will be thrown if it doesn't exist
expect(function(){
httppole.createClient({});
}).to.throw("function createClient requires an endpoint")
var httppole = require('httppole');
var client = httppole.createClient({
endpoint: 'localhost:4000'
});
var screenMessage = "This is a message";
var screenLine = 1;
client.message(screenMessage, screenLine, function(error, success){
if (error) {
console.log('something went wrong with our edison', error);
return callback(error);
}
return callback(null, "Successfully updated the screen");
});
var httppole = require('httppole');
var client = httppole.createClient({
endpoint: 'localhost:4000'
});
var query = "98034" || "Seattle" || "Maui" || "Paris,FR"
client.weather(query, function(error, success){
if (error) {
console.log('something went wrong with our edison', error);
return callback(error);
}
return callback(null, "updated screen with forecast");
});
From the repo root:
npm install
npm test