0

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)

1 Answer 1

1

If it were me I wouldn't try to graft Node.js into a Jimdo site. I did a quick review and I don't think they host apps like that. I'm guessing they're like GoDaddy's Website Tonight template thing or whatever.

I think I would open an account on OpenShift, add a MongoDB cartridge to your main app, edit your app to use their environment variables and for MongoDB support and then "git push" your code up there. Unfortunately, they don't have an Influx cartridge that I can see. (MySQL, MongoDB, PostgreSQL, SQLite, Amazon RDS)

Maybe someone here can talk up Heroku's cartridges. A quick Google search suggests they also don't support Influx.

Sign up to request clarification or add additional context in comments.

2 Comments

Definitely a better option. I didn't even realize that was possible.
And for the basic setup it's free for the first three gears.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.