Skip to content

kolarcz/node-iftttmaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iftttmaker

Sending requests to IFTTT Maker channel with node.js

Instalation

npm install iftttmaker

Methods

require('iftttmaker')(apiKey)

Creates an instance of the IFTTTMaker with IFTTT Maker apiKey.

IFTTTMaker.send(event [, value1 [, value2 [, value3]]] [, callback(error)])

Sends a request with specified event and values value1, value2 and value3 and return Promise. You can also use callback.

IFTTTMaker.send({ event: event, values: { value1: value1, ... value3 }} [, callback(error)])

Another option with params as object.

IFTTTMaker.setProxy(proxyAddress)

Set proxy to connect to.

Examples

var apiKey = 'VJWqWLSLX3gfbvhR1bmYfi';
var IFTTTMaker = require('iftttmaker')(apiKey);

IFTTTMaker.send('notify', 'hello', 'world').then(function () {
  console.log('Request was sent');
}).catch(function (error) {
  console.log('The request could not be sent:', error);
});
var apiKey = 'VJWqWLSLX3gfbvhR1bmYfi';
var IFTTTMaker = require('iftttmaker')(apiKey);

// do you need to connect via proxy?
// IFTTTMaker.setProxy('https://10.0.0.3:1234');

var request = {
  event: 'notify',
  values: {
    value1: 'hello',
    value2: 'world'
  }
};

IFTTTMaker.send(request, function (error) {
  if (error) {
    console.log('The request could not be sent:', error);
  } else {
    console.log('Request was sent');
  }
});

About

Sending requests to IFTTT Maker channel with node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published