Skip to content

Instantly share code, notes, and snippets.

View georgeportillo's full-sized avatar
🎯
Focusing

George Portillo georgeportillo

🎯
Focusing
View GitHub Profile
function init() {
// Ask user for input, store in userKilometers.
let userKilometers = display('How many kilometers to convert?')
// Get amount of miles from the amount of kilometers, store in convertedMiles.
let convertedMiles = milesTotal(userKilometers);
// Display the amount of miles.
display('You have driven ${convertedMiles} in total!')
}
function milesTotal(userKilometers)
{
"entry": [{
"id": "39067632506",
"time": 1489304167705,
"messaging": [{
"sender":{
"id": "1713278708698563"
},
"recipient":{
"id": "39067632506"
/**
* sendEngagement - Sends an engagement message to all users.
*
* @param {Object} req The request object.
* @param {Object} res The response object.
*/
export function sendEngagement(req, res) {
let engagement = req.body.engagement;
Bot.findOne({
==========================
Image reference
==========================
http://i.imgur.com/lb5mqqP.png
==========================
JSON
==========================
{
"_id": {
================
Get started
================
{
"entry": [{
"id": "39067632506",
"time": 1489304167705,
"messaging": [{
"sender": {
"id": "1713278708698563"
module.exports = "facebook";
(function(window, angular, undefined) {
'use strict';
// Module global settings.
var settings = {};
// Module global flags.
var flags = {
find . -maxdepth 2 | # Find files
grep ".html" | # Grep for all html files
xargs -I % grep "\"solution-apis-used_list_item\"" % | # Search for a string in those files
wc -l # Return number of found instances
// Simulate get started
{
"entry": [{
"id": "<PAGE_ID>",
"time": 1489304167705,
"messaging": [{
"sender": {
"id": "<USER_ID>"
},
"recipient": {
////
// Get started
// This is a webhook postback with event (an event determines which API.ai intent
// will fire when a button with an event payload is clicked).
// See example: http://i.imgur.com/jPFHuZ2.png (see events, in this case, the
// getstarted intent will fire because in the payload, the event is getStarted.
// It's like a unique identifier.
////
{
"entry": [{
{
"entry": [{
"id": "39067632506",
"time": 1489304167705,
"messaging": [{
"sender": {
"id": "1713278708698563"
},
"recipient": {
"id": "39067632506"