You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be too difficult to set up for most users... but maybe it could be done... everytime your d3ck moves you could have it tweet it's current location. That way your d3ck simply needs to follow its pals on twitter (or do ad-hoc lookups) and any lookups or whatnot are obviated. Twitter IDs would usually map to d3ck ids, probabably not a lot of competition for user "CE8394545CB81F25E1132A1BFEC7D1F5AB705318" ;) You need to get all that API keys, which is a bit of a pain.
POC code for a d3ck to tweet (with hardcoded IP......) below.
!/usr/bin/env node
var fs = require('fs')
var Twitter = require('node-twitter');
var keyz_loc = '/etc/d3ck/conf/twitter.json'
var twit_keyz = JSON.parse(fs.readFileSync(keyz_loc).toString())
console.log('keyz: ' + JSON.stringify(twit_keyz))
var twitterRestClient = new Twitter.RestClient(
twit_keyz.CONSUMER_KEY,
twit_keyz.CONSUMER_SECRET,
twit_keyz.TOKEN,
twit_keyz.TOKEN_SECRET
)
var my_ip = JSON.stringify({d3ck_ip: '63.225.191.45'})
console.log('my_ip: ' + my_ip)
twitterRestClient.statusesUpdate({ status: my_ip }, function(error, result) {
if (error) {
console.log('Tweet Errz: ' + (error.code ? error.code + ' ' + error.message : error.message));
}
else if (result) {
console.log(result);
}
else {
console.log('tweet-no-zone... hmm, not sure how to deal with this :)')
}
});
The text was updated successfully, but these errors were encountered:
It might be too difficult to set up for most users... but maybe it could be done... everytime your d3ck moves you could have it tweet it's current location. That way your d3ck simply needs to follow its pals on twitter (or do ad-hoc lookups) and any lookups or whatnot are obviated. Twitter IDs would usually map to d3ck ids, probabably not a lot of competition for user "CE8394545CB81F25E1132A1BFEC7D1F5AB705318" ;) You need to get all that API keys, which is a bit of a pain.
POC code for a d3ck to tweet (with hardcoded IP......) below.
!/usr/bin/env node
var fs = require('fs')
var Twitter = require('node-twitter');
var keyz_loc = '/etc/d3ck/conf/twitter.json'
var twit_keyz = JSON.parse(fs.readFileSync(keyz_loc).toString())
console.log('keyz: ' + JSON.stringify(twit_keyz))
var twitterRestClient = new Twitter.RestClient(
twit_keyz.CONSUMER_KEY,
twit_keyz.CONSUMER_SECRET,
twit_keyz.TOKEN,
twit_keyz.TOKEN_SECRET
)
var my_ip = JSON.stringify({d3ck_ip: '63.225.191.45'})
console.log('my_ip: ' + my_ip)
twitterRestClient.statusesUpdate({ status: my_ip }, function(error, result) {
if (error) {
console.log('Tweet Errz: ' + (error.code ? error.code + ' ' + error.message : error.message));
}
else if (result) {
console.log(result);
}
else {
console.log('tweet-no-zone... hmm, not sure how to deal with this :)')
}
});
The text was updated successfully, but these errors were encountered: