Skip to content

Instantly share code, notes, and snippets.

View ObjectIsAdvantag's full-sized avatar

Stève Sfartz ObjectIsAdvantag

View GitHub Profile
@ObjectIsAdvantag
ObjectIsAdvantag / devnet3002-step3.js
Created July 6, 2016 13:46
DEVNET3002 - Step 3 - ChatOps
// QUICK START GUIDE
//
// 1. Clone this gists and make it secrete
// 2. Create an incoming integratin in a Spark Room from the Spark Web client : http://web.ciscospark.com
// 3. Replace INCOMING_INTEGRATION_SUFFIX by the integration id, example: Y2lzY29zcGFyazovL3VzL1dFQkhPT0svZjE4ZTI0MDctYzg3MS00ZTdmLTgzYzEtM2EyOGI1N2ZZZZZ
// 4. Create your Tropo application pointing to your gist URL, append /raw/tropodevops-sample.js to the gist URL
//
// Cisco Spark Logging Library for Tropo
//
wait(1000);
say("Welcome to the alphabet recognizer");
wait(1000);
ask("Please spell your word, and press # when done", {
choices:"https://gist.githubusercontent.com/ObjectIsAdvantag/fdd65dcff2b6518fa741130b36060870/raw/mygrammar.xml",
terminator:"#",
attempts:3,
<?xml version="1.0"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" root="main">
<rule id="main" scope="public">
<item repeat="1-16">
<ruleref uri="#alphabet">
<tag>out.concept = out.concept + rules.alphabet;</tag>
</ruleref>
</item>
@ObjectIsAdvantag
ObjectIsAdvantag / zurich-test-temporary.js
Last active September 4, 2016 22:02
Zurich - test at arrival
if (currentCall) {
say("Welcome to Zurich");
wait(500);
say("See you at the hackathon");
}
else {
call(phonenumber, { "network":canal });
//call(phonenumber);
say(msg);
}
if 'currentCall' in locals():
msg = currentCall.initialText
if msg == "yes":
say("go get some")
else:
say("I am not a big coffee drinker myself neither")
else:
call(phonenumber, {"network":"SMS"})
say("do you want coffee ?")
if (currentCall) {
choice = currentCall.initialText.toLowerCase();
if ((choice.startsWith("yes")) || (choice.startsWith("yep")) || (choice.startsWith("sure")) || (choice.startsWith("oui"))) {
say("go get some !");
}
else {
if ((choice.startsWith("no")) || (choice.startsWith("non"))) {
say("well, I am not a big coffee drinker myself neither...");
}
else {
@ObjectIsAdvantag
ObjectIsAdvantag / tropo-IVR-end2end-sample
Last active September 17, 2016 11:53
Tropo Javascipt IVR that asks for activities from an external API, sends an SMS, picks email addresses, adds particimants to a Spark room,, and does ChatOps to Spark: from Cisco Live Vegas 2016: http://www.slideshare.net/CiscoDevNet/cisco-spark-tropo-api-workshop/2
// QUICK START GUIDE
//
// 1. Clone this gists and make it private
// 2. Create an incoming integratin in a Spark Room from the Spark Web client : http://web.ciscospark.com
// 3. Replace YOUR_INTEGRATION_SUFFIX by the integration id, example: Y2lzY29zcGFyazovL3VzL1dFQkhPT0svZjE4ZTI0MDctYzg3MS00ZTdmLTgzYzEtM2EyOGI1N2ZZZZZ
// 4. Create your Tropo application pointing to your gist URL, append /raw/tropodevops-sample.js to the gist URL
//
// Cisco Spark Logging Library for Tropo
//
@ObjectIsAdvantag
ObjectIsAdvantag / scenario - CiscoSpark ChatOps
Last active January 4, 2017 17:19
HackZurich - Setup a ChatOps scenario with Cisco Spark
create a Group room
- from Spark API
- or from Web client with 2 people + you
- change the name of the room to Chatops
- add a message stating this is where my logs will go
add an integration
- create it as an incoming webhook
- name if "from my server"
create an account on Tropo.com
- this will be the longest task
create a script
@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));