Make Jibo post status message on Facebook with IFTTT


#1

Build upon How-to: Connect Jibo SDK to IFTTT Maker recipe (in 10 minutes) & the Look-away Skill by The Web Pro

Here is an easy way to make your Jibo Speak some words on your Facebook.

Step 1, Connect to IFTTT maker (https://ifttt.com/maker) and logon to your account. Click Connect. Copy the key shown…you’ll need this later.

Step 2, Create a new recipe: click My Recipes, then click Create a Recipe.

Step 3, Click this

Step 4, Search for facebook

Step 5, Login to your facebook account

Step 6, Click continue to the next step

Step 7, Click create a status message

Step 8, Complete the action fields

Step 9, Create a new project in your Jibo SDK. Don’t forget to run the npm install. You can also use an existing project if you wish.

Step 10, Add the npm module iftttmaker to your project. To do this, just navigate your console to your projects folder and npm install iftttmaker.

Step 11, Create a new behaviour named fbpost.bt.

Step 12, Create a new ExecuteScript behavior for your IFTTT Maker recipe call. You can also use an ExecuteScriptAsync behavior if you want Jibo to pause until the IFTTT call succeeds (or fails). Copy/paste the appropriate code for your choice below:

ExecuteScript

() => {
var apiKey = ‘[YourKey]’;
var IFTTTMaker = require(‘iftttmaker’)(apiKey);
var action = ‘FBpost’;
// Promise
IFTTTMaker.send(action, ‘Any text here, Any text here’).then(function () {
console.log(‘Request was sent’);
}).catch(function (error) {
console.log(‘The request could not be sent:’, error);
});
}

ExecuteScriptAsync

(succeed, fail) => {
var apiKey = ‘[API_KEY]’;
var IFTTTMaker = require(‘iftttmaker’)(apiKey);
var action = ‘[EVENT_NAME]’;
// Callback
IFTTTMaker.send(action, ‘[EMAIL_SUBJ]’, ‘[EMAIL_BODY]’, function (error) {
if (error) {
console.log(‘The email could not be sent:’, error);
fail();
} else {
console.log(‘Email was sent’);
succeed();
}
});
}

SDK example:

Change the placeholders to match your info: Change the [API_KEY] to the IFTTT Maker API key you recorded in Step 1. Change the [EVENT_NAME] to the event name you chose in Step 3, in this case FBpost.
Were Any text here = any info you need to your IFTTT Maker recipe action using “Value1” and “Value2” in your IFTTT recipe…

Step 13, Create a new subtree behaviour in main.bt with behavior path fbpost.bt

SDK example:

Step 14: Run the skill to see Jibo post your message to Facebook!

We will update this post when ready with a detailed description how you can parse the “spoken” text to jibo in the Value1, Value2.


Send SMS with Jibo & IFTTT