Anonymous View
1.0.14 • Published 9 years ago

maker-webtask v1.0.14

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 years ago

maker-webtask

Consume message between IFFT (Maker) and other webtask-queue consumers

Setup

  1. Follow the steps to setup a webtask queue
  2. Setup your IFTTT Channel to listen for maker commands at the queue output above. You will want it to POST a body similar to the below:
{
    "device": "<NAME OF DEVICE TO LISTEN FOR>",
    "command": "<SPECIFIC DETAILS TO REACT UPON>"
}
  1. Set an environment variable for the webtask queue above
  2. Set the environment variable MAKER_WEBTASK_URL giving it the above url
  3. Set the environment variable WEBTASK_SECRET giving it the secret used in the step above
  4. Add the package as an NPM package reacting to these commands
var makerWebtask = require('maker-webtask');
var webtaskUrl = ...; // The url from the first step above
function turnOnLight(message) {
  if (message.command === 'on') {
    // Turn light on
  }
}
var pollingInterval = 5; // Check the queue every 5 seconds due to quotas
makerWebtask.run('lightbulb', turnLightOn, pollingInterval);

With the above example, when Maker calls the above URL with the following body:

{
    "device": "lightbulb",
    "command": "on"
}

The light will turn on.

1.0.14

9 years ago

1.0.13

10 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago