Skip to content

Instantly share code, notes, and snippets.

View ObjectIsAdvantag's full-sized avatar

Stève Sfartz ObjectIsAdvantag

View GitHub Profile
@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"
@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
//
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 {
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 ?")
@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);
}
<?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>
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,
@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
//
@ObjectIsAdvantag
ObjectIsAdvantag / devnet3002-step2.js
Last active July 5, 2016 11:41
DEVNET3002 - Step 2 - SMS Bridge
//
// Cisco Spark Client Library for Tropo
//
// Factory for the Spark Library, with 1 parameter
// - the Spark API token
function SparkClient(spark_token) {
if (!spark_token) {
log("SPARK_CLIENT : bad configuration, no API token, exiting...");
@ObjectIsAdvantag
ObjectIsAdvantag / devnet3002-step1.js
Last active July 6, 2016 10:41
DEVNET3002 - Step 1 - IVR - Tropo Voice script
answer();
wait(1000); // On-boarding pause : do not speak too quickly the IVR
// Pick a voice depending on your language & preference (male/female)
// https://www.tropo.com/docs/scripting/international-features/speaking-multiple-languages
var currentVoice = "Ava"; // Allison, Ava, Samantha, Susan, Veronica, Vanessa (Default), Tom, Victor
say("Hello, Welcome to the DevNet Quiz !", { voice: currentVoice });
wait(500);