Skip to content

Instantly share code, notes, and snippets.

View mheadd's full-sized avatar

Mark Headd (He/Him) mheadd

View GitHub Profile
{"servicetypedefinition": [
{"servicetype": [{"servicetype": "Abandoned Bicycles"}, {"servicecode": "S0021"}, {"name": "ABDBIC-HOWLONG"}, {"prompt": "How long has the bicycle been abandoned?"}, {"required": "Y"}, {"type": "TextBox "}, {"width": "200"}, {"itemlist": "\r"}]},
{"servicetype": [{"servicetype": "Abandoned Bicycles"}, {"servicecode": "S0021"}, {"name": "ABDBIC-NOWHEELS"}, {"prompt": "Are the wheels missing?"}, {"required": "Y"}, {"type": "DropDown "}, {"width": "16"}, {"itemlist": "Yes,No,Don't know\r"}]},
{"servicetype": [{"servicetype": "Abandoned Bicycles"}, {"servicecode": "S0021"}, {"name": "ABDBIC-AIRINTIRES"}, {"prompt": "Is there air in the tires?"}, {"required": "Y"}, {"type": "DropDown "}, {"width": "16"}, {"itemlist": "Yes,No,Don't know\r"}]},
{"servicetype": [{"servicetype": "Abandoned Bicycles"}, {"servicecode": "S0021"}, {"name": "ABDBIC-RUSTY"}, {"prompt": "Are the chain and other components rusty?"}, {"required": "Y"}, {"type": "DropDown "}, {
@mheadd
mheadd / billProwl.php
Created October 26, 2009 18:50
Get bill status updates from the NY Senate Open Leg API sent to your Prowl iPhone client.
<?php
/*
* Contents of file billProwl.php
*/
// Include PHP Prowl class.
require('path/to/ProwlPHP.php');
// The argument passed in when the script was invoked (bill number).
@mheadd
mheadd / im_bot_class.php
Created November 4, 2009 15:55
A class for creating IM/SMS/Twitter bots
<?php
/*
* Copyright 2009 Mark J. Headd
*
* This file is part of the PHP IM Bot Class
*
* PHP IM Bot Class is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
<?php
/*
* Class to compare user agent string with Voxeo Prophcy versions.
*/
class sniffer {
private $smsUserAgentString = 'Voxeo-VXML/10';
private $phoneUserAgentString = 'Voxeo-VXML/8';
<?php
include('class.sniffer.php');
$user_agent = $_SERVER['HTTP_USER_AGENT'];
try {
$sniffy = new sniffer($user_agent);
$channel_type = $sniffy->getChannelType();
}
<?php
// User defined constants.
define("COUCH_DB_USER", "");
define("COUCH_DB_PASSWORD", "");
define("COUCH_DB_NAME", "call_logs/");
define("COUCH_DB_DESIGN_DOCUMENT_NAME", "");
define("COUCH_DB_SHOW_FUNCTION_NAME", "");
// Base URL for accessing Couch DB instance on remote host.
<?php
// User defined constants.
define("COUCH_DB_USER", "");
define("COUCH_DB_PASSWORD", "");
define("COUCH_DB_NAME_LOGS", "call_logs/");
define("COUCH_DB_NAME_EXT", "call_settings/");
define("COUCH_DB_DESIGN_DOCUMENT_NAME", "");
define("COUCH_DB_SHOW_FUNCTION_NAME", "");
<status>
<created_at>Mon Jan 18 17:42:52 +0000 2010</created_at>
<id>7911766753</id>
<text>If my city had an #Open311 API, this Tweet could start a service request. http://twitpic.com/yo8k2 #pothole</text>
<source>&lt;a href=&quot;http://www.tweetdeck.com/&quot; rel=&quot;nofollow&quot;&gt;TweetDeck&lt;/a&gt;</source>
<truncated>false</truncated>
<in_reply_to_status_id></in_reply_to_status_id>
<in_reply_to_user_id></in_reply_to_user_id>
<favorited>false</favorited>
<in_reply_to_screen_name></in_reply_to_screen_name>
<?php
/*
* PHP Classes for interacting with the Voxeo Tropo Web API.
* Copyright 2009 Mark J. Headd.
* www.voiceingov.org
*/
/*
* Class for interacting with the Tropo Web API.
<?php
/*
* A simple example the demonstrates the PHP language binding to the Tropo Web API.
* This example uses the Limonade PHP micro framework:
* http://limonade.sofa-design.net/
*
* In order to work, you need to set up your call route in Tropo to match the start
* route below, and use the appropriate querystring paramter for the Tropo Web API:
* http://ip_address_of_your_server/tropo_test.php?uri=start&tropo-engine=json