Skip to content

Instantly share code, notes, and snippets.

View mheadd's full-sized avatar

Mark Headd mheadd

View GitHub Profile
@mheadd
mheadd / Main.cs
Created June 20, 2011 17:38
C# console application to send an SMS message through SMSified
using System;
using System.Text;
using System.Net;
using System.IO;
namespace smsifiedexample
{
class MainClass
{
public static void Main (string[] args)
@mheadd
mheadd / chloe.html
Created June 22, 2011 16:08
Conferencing Dashboard Demo built with Tropo and Chloe
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8901/chloe.js"></script>
<script type="text/javascript">
// Function to return a formatted time.
function getTime() {
var theDate = new Date();
var hours = theDate.getHours() > 12 ? theDate.getHours() -12 : theDate.getHours();
@mheadd
mheadd / septa.md
Created June 23, 2011 16:52
SEPTA Bus / Train API info
@mheadd
mheadd / chloe.html
Created June 30, 2011 13:29
Sample Code from Philly Lambda Presentation - 6/29/2011
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="http://127.0.0.1:8901/chloe.js"></script>
<script type="text/javascript">
// Function to return a formatted time.
function getTime() {
var theDate = new Date();
var hours = theDate.getHours() > 12 ? theDate.getHours() -12 : theDate.getHours();
@mheadd
mheadd / lookup.php
Created July 5, 2011 20:59
Tropo PHP script to look up a Phono-powered agent stored in a CouchDB instance.
<?php
// CouchDB settings.
define("COUCHDB_HOST","http://127.0.0.1");
define("COUCHDB_PORT","5984");
define("COUCHDB_VIEW","ready");
// Method to retrieve available agent listing from CouchDB.
function lookupAgent() {
$url = COUCHDB_HOST.":".COUCHDB_PORT."/remoteagent/_design/remoteagent/_view/".COUCHDB_VIEW;
@mheadd
mheadd / curl-example.txt
Created July 6, 2011 12:33
Example curl command for setting a subscription URL in SMSified.
curl -X POST "https://api.smsified.com/v1/smsmessaging/inbound/subscriptions?destinationAddress=4078889999&notifyURL=http://www.example.com/inbound" -u 'username:password'
@mheadd
mheadd / weight.xml
Created August 2, 2011 00:33
SRGS grammar in XML format for capturing weight information.
<?xml version="1.0" encoding="ISO-8859-1"?>
<grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd"
version="1.0" xml:lang="en-US" mode="voice" root="main">
<!-- Main gramar rule -->
<rule id="main" scope="public">
<item>
<ruleref uri="#first" />
</item>
@mheadd
mheadd / Ask.cs
Created August 11, 2011 18:49
C# /ASP.NET code behind showing how to process and use Tropo Result object.
using System;
using TropoCSharp.Tropo;
namespace TropoDemo
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Create a new instance of the Tropo object.
@mheadd
mheadd / config.js
Created August 17, 2011 15:44
Node Knockout Demo Application
/**
* Enter your configuration details in this file.
*/
// Details of your CouchDB instance.
exports.couchdb = {
userid : '',
password : '',
host : 'http://127.0.0.1',
port : '5984',
@mheadd
mheadd / tropo.js
Created August 18, 2011 20:00
Sample Tropo app written in Node.js with the Express Framework.
/**
* Sample Tropo app written in Node.js with the Express Framework.
*/
var tropo = require('tropo-webapi');
var express = require('express');
var port = process.ARGV[2] || 8000;
var app = express.createServer();