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
const client = new irc.Client('irc.smurfnet.ch', 'pbclimate',{
channels : ['#pixelbar']
})
client.addListener('message', (from, to, message) => {
//console.log(from, to, message)
if(message.indexOf('!temp') != -1) {
var request = http.get("http://172.30.101.3:8080/temp.json", function(response) {
var str = ''
response.on('data', function (chunk) {
str += chunk;
});
response.on('end', function() {
//console.log(str);
try{
const tempdata = JSON.parse(str)
client.say('#pixelbar','Temperature is '+tempdata.BarometerTemperature+'C, Pressure is '+tempdata.BarometerPressure + 'Pa and Humidity is '+tempdata.Humidity+'%')