Spark.login({ username: process.env.PARTICLE_EMAIL, password:process.env.PARTICLE_PASS }, function(err, body) { Spark.callFunction(process.env.PARTICLE_ID,'setMode',isHappy,function(err,data){ console.log("Spark has finished"); }); });
stream.on('tweet', function (tweet) { Spark.callFunction(process.env.SPARK_ID, 'setMode', '6', function (err, data) {}); if (tweet['retweeted_status'] != null) { Spark.callFunction(process.env.SPARK_ID, 'setMode', '7', function (err, data) {}); } })
stream.on('unfollow', function (tweet) { console.log('HAS BEEN FOLLOWED', tweet) if (tweet['target']['screen_name'] == "bitchwhocodes") { Spark.callFunction(process.env.SPARK_ID, 'setMode', '5', function (err, data) {}); } })
stream.on('list_member_added', function (tweet) { Spark.callFunction(process.env.SPARK_ID, 'setMode', '6', function (err, data) {}); })
stream.on('favorite', function (tweet) { Spark.callFunction(process.env.SPARK_ID, 'setMode', '3', function (err, data) {}); })