I wrote a node.js script to subscribe to my dweet.io thing and log the dweet with InfluxDB. It works well when I run it on localhost (using node script.js from terminal). When I post a dweet, it notices and sends the information to InfluxDB.
var dweetClient = require("node-dweetio");
var influx = require('influx')
// setup influxdb
var database = 'MyTestDatabase'
var seriesname = 'testdata'
var db = influx({
host: 'localhost',
port: '8086',
username: 'root',
password: 'root',
database: database
})
// Dweet handling
var dweetio = new dweetClient();
var mything = "TestRepository" // name of your dweet “thing”
dweetio.listen_for(mything, function(dweet) { // wait for a dweet to be posted
// save to InfluxDB
db.writePoint('testdata', dweet.content, function(err) { // save dweet content to influxdb
if(err) throw err;
})
});
I have a website though and I think the better thing to do is link it to that instead of localhost. That way, it isn't beholden to my personal computer. Unfortunately, I know nothing about web dev. The site is externally hosted by Jimdo. Is there a way to connect this script to the website without having full access to the server?
(I apologize for butchering the terminology! I hope the question is clear enough without knowing all the jargon)