Skip to content

Instantly share code, notes, and snippets.

View ObjectIsAdvantag's full-sized avatar

Stève Sfartz ObjectIsAdvantag

View GitHub Profile
@ObjectIsAdvantag
ObjectIsAdvantag / tropo-recast.js
Last active December 10, 2016 22:19
Snippet to invoke Recast.ai from Tropo
// POST https://api.recast.ai/v2/request
// Authorization=Token YOUR_RECAST_TOKEN
// {
// "text" : "I need somone speaks swedish",
// "language" : "en"
// }
function invokeRecast(token, text, language) {
try {
// Open Connection
var url = "https://api.recast.ai/v2/request";
@ObjectIsAdvantag
ObjectIsAdvantag / ciscospark-tropo-bridge.js
Last active December 4, 2016 02:27
SMS Bridge: text your email to a Tropo number, get added to a Cisco Spark room
// QUICK START GUIDE
//
// 1. Create a Cisco Spark bot account, named 'bridge' for example, and store its token
// 2. Create a room, named 'SMS Bridge', store its roomId, and add your 'bridge' bot to the room
// 3. Create a Cisco Spark Chatops bot account, and store its token
// 4. Create 2 Chat rooms, 1 for Logs and 1 for Debug, and add your Chatops bot in there
// 5. Clone this gists and make it private, and edit it
// 6. Replace the bridge bot token and room, as well as the chatops bot token and chat rooms
// 7. Create a Tropo scripting application pointing to your gist raw URL (and remove the revision number to point to the latest version)
wait(1000);
say("Welcome to TechCrunch Disrupt 2016");
wait(1000);
say("Join the Cisco Cloud Collaboration Challenge, play with our Communications APIs (Chat, Voice, SMS, Video, Meetings) and win Four Thousands dollars in cash");
wait(1000);
// QUICK START GUIDE
//
// 1. Create a Cisco Spark bot account, named 'bridge' for example, and store its token
// 2. Create a room, named 'SMS Bridge', store its roomId, and add your 'bridge' bot to the room
// 3. Create a Cisco Spark Chatops bot account, and store its token
// 4. Create 2 Chat rooms, 1 for Logs and 1 for Debug, and add your Chatops bot in there
// 5. Clone this gists and make it private, and edit it
// 6. Replace the bridge bot token and room, as well as the chatops bot token and chat rooms
// 7. Create a Tropo scripting application pointing to your gist raw URL (and remove the revision number to point to the latest version)
var csvFile = loadFile("http://hosting.tropo.com/5051540/www/data/numbers.csv");
var numbersToDial = csvJSON(csvFile);
for (var i = 0; i<numbersToDial.length-1; i++){
var callee = numbersToDial[i];
call(callee.number, { network: "SMS" });
say("Hi, " + callee.name);
hangup();
}
say("Thank you for calling the random strategies hotline");
ask("Please enter your phone number followed by the pound sign", {
choices: "[9-12 DIGITS]",
terminator: "#",
mode: "dtmf",
onChoice: function(event) {
var quote = pickRandomQuote ();
message(quote, {
to: event.value,
/*
* Copyright (c) 2009 - 2015 Tropo, now part of Cisco
* Released under the MIT license. See the file LICENSE
* for the complete license
*/
// --------------------------------------------
// Simple example of recording
// --------------------------------------------
@ObjectIsAdvantag
ObjectIsAdvantag / tropo-IVR-hackposte-tag-2016.js
Created September 23, 2016 14:41
IVR for HackPoste mobile
if (!currentCall) { // No tropo session yet => this is an outgoing call initiated via Tropo token url
var offset = +2; // CET+2
var now = new Date(Date.now() + (3600000 * offset));
call(phonenumber);
say("it is now " + now.getHours() + ":" + now.getMinutes() + " in Paris, Rome, Madrid, Berlin, Zurich and Amsterdam.");
wait(500);
offset = +1; // CET+1
now = new Date(Date.now() + (3600000 * offset));
@ObjectIsAdvantag
ObjectIsAdvantag / tropo-IVR-intro-Europe.js
Last active September 19, 2016 12:24
Simple IVR to introduce Tropo Voice concepts at events in Europe. Applies for HackZurich
if (!currentCall) { // No tropo session yet => this is an outgoing call initiated via Tropo token url
var offset = +2; // CET+2
var now = new Date(Date.now() + (3600000 * offset));
call(phonenumber);
say("it is now " + now.getHours() + ":" + now.getMinutes() + " in Paris, Rome, Madrid, Berlin, Zurich and Amsterdam.");
wait(500);
offset = +1; // CET+1
now = new Date(Date.now() + (3600000 * offset));
create an account on Tropo.com
- this will be the longest task
create a script