Skip to content

Instantly share code, notes, and snippets.

@leoaiassistant
leoaiassistant / ChatBanking.js
Last active July 24, 2019 19:48
Mobile banking through popular apps is a chatbot intended to be utilized by banks to give services to their customers. A customer will be able to sign up to the bot via facebook.com and use services as Query account balance Set alert transactions Notifications based on purchase amounts etc.
'use strict';
import {} from 'dotenv/config'
const
bodyParser = require('body-parser'),
express = require('express'),
request = require('request'),
httpStatus = require('http-status'),
morgan = require('morgan'),
cluster = require('cluster');
@leoaiassistant
leoaiassistant / index.js
Created July 25, 2019 00:11
Integration of Fulfillment with Firestore in Nodejs
'use strict';
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const {WebhookClient} = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:*'; // enables lib debugging statements
admin.initializeApp(functions.config().firebase);
const db = admin.firestore();
@leoaiassistant
leoaiassistant / iata.csv
Created July 25, 2019 20:09
+3500 códigos iata de aeropuertos internacionales para entrenamiento de modelo NLP.
Aalborg, Denmark AAL
Aalesund, Norway AES
Aarhus, Denmark - Bus service ZID
Aarhus, Denmark - Tirstrup AAR
Aasiaat, Greenland JEG
Abadan, Iran ABD
Abakan, Russia ABA
Abbotsford, BC YXX
Aberdeen, SD ABR
Aberdeen, United Kingdom ABZ
@leoaiassistant
leoaiassistant / Funciones.js
Created July 25, 2019 20:25
Función para ejecutar respuestas matemáticas como la sumatoria, promedio, división, multiplicaión, entre otras a través de node.js para Actions on google & Dialogflow
function facturar (agent) {
let numerotickets = agent.parameters.ordentickets;
const precio = 20;
for (let i = 0; i < agent.parameters.ordentickets.lenght; i++)
{
numerotickets += agent.parameters.ordentickets[1].number;
}
let total = precio * numerotickets;
We couldn’t find that file to show.
We couldn’t find that file to show.
We couldn’t find that file to show.
{
  name: 'Oscar Barajas', 
  photo: '<URL_IMG>', 
  bio: 'Oscar Barajas Bio',
  jobTitle: 'Foundation Layer & Frontend Developer @Platzi',
  conferenceTitle: 'React y un mundo de posibilidades',
  description: 'Complete bio or description',
  social: [
    {name: 'twitter', url: 'twitter.com/gndx'},

{name: 'instagram', url: 'instagram.com/gndx'}

// Enter your calendar ID below and service account JSON below
const calendarId = "<your_Calendar_ID>";
const serviceAccount = {
"type": "service_account",
"project_id": "your_JSON_ID",
"private_key_id": "your_JSON_ID",
"private_key": "your_JSON_ID-----END PRIVATE KEY-----\n",
"client_email": "your_JSON_ID",
"client_id": "your_JSON_ID",
var nombreHoja = "Hoja 1"
var user_id = "Ingrese_IG_ID"; //Encuentre el IG ID (únicamente números) aquí: https://codeofaninja.com/tools/find-instagram-user-id
var instagram_base_url = "https://www.instagram.com/graphql/query/";
var following = "?query_hash=58712303d941c6855d4e888c5f0cd22f&variables=%7B%22id%22%3A%22" + user_id + "%22%2C%22first%22%3A24%7D"
var followers = "?query_hash=37479f2b8209594dde7facb0d904896a&variables=%7B%22id%22%3A%22" + user_id + "%22%2C%22first%22%3A24%7D"
var medias = "?query_hash=f2405b236d85e8296cf30347c9f08c2a&variables=%7B%22id%22%3A%22" + user_id + "%22%2C%22first%22%3A12%7D"
function contarSeguidores() {