<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hilarymason.com - Hilary Mason &#187; projects</title>
	<atom:link href="http://www.hilarymason.com/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hilarymason.com</link>
	<description>I'm a computer science professor, data scientist, and web geek.</description>
	<lastBuildDate>Tue, 16 Feb 2010 20:45:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SMS to e-mail gateway: The SMS doorbell</title>
		<link>http://www.hilarymason.com/blog/sms-to-e-mail-gateway-the-sms-doorbell/</link>
		<comments>http://www.hilarymason.com/blog/sms-to-e-mail-gateway-the-sms-doorbell/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 04:41:03 +0000</pubDate>
		<dc:creator>Hilary Mason</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[nycresistor]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[textmarks]]></category>

		<guid isPermaLink="false">http://www.hilarymason.com/?p=399</guid>
		<description><![CDATA[Over at NYC Resistor, it was getting cold, and we needed a doorbell so visitors wouldn&#8217;t be stranded outside when the building was locked. A standard wireless model didn&#8217;t work reliably (the space is on the fifth floor, just out of range), so various members generally resorted to writing their phone numbers on a sign [...]]]></description>
			<content:encoded><![CDATA[<p>Over at <a href="http://www.nycresistor.com">NYC Resistor</a>, it was getting cold, and we needed a doorbell so visitors wouldn&#8217;t be stranded outside when the building was locked. A standard wireless model didn&#8217;t work reliably (the space is on the fifth floor, just out of range), so various members generally resorted to writing their phone numbers on a sign on the front door when they were expecting guests.</p>
<p>Since almost everyone has a mobile phone already, and SMS-based solution seemed appropriate. In order to implement this we need two things:</p>
<ol>
<li>An SMS shortcode</li>
<li>A system to notify when the shortcode is triggered</li>
</ol>
<p>It&#8217;s irritating and expensive to acquire your own shortcode, but there are several services that will allow you to use one in exchange for a small fee or advertisements in your messages. <a href="http://www.textmarks.com">TextMarks</a> is my favorite (I used TextMarks for my <a href="http://www.hilarymason.com/blog/mobile-app-whereami/">WhereAmI</a> project). While TextMarks markets their service as a system for mobile mailing lists, they allow you to reserve a keyword and define a behavior (that can include pulling data from a URL!) to occur when that keyword is triggered.</p>
<h3>Configuring TextMarks</h3>
<p><img class="alignleft size-full wp-image-407" title="textmarks_configuration" src="http://www.hilarymason.com/wp-content/uploads/2010/01/textmarks_configuration1.png" alt="textmarks_configuration" width="424" height="338" />Sign up for <a href="http://www.textmarks.com">TextMarks</a> and choose a keyword. Configure the keyword to respond with the &#8220;First 120 characters on web page&#8221;, and point it at the future home of your script (you can always come back and modify this later).</p>
<p>Note the <span class="code">\0</span> as the value of the <span class="code">msg</span> parameter &#8212; this instructs TextMarks to send along any additional message contents as the value of that parameter. That means if someone were to text 41411 &#8220;doorbell hi this is hilary&#8221;, TextMarks would call the script with the param msg=hi this is hilary. This can be quite useful.</p>
<h3>The Script</h3>
<p>This script is written in Python, but you can use any scripting language you like. This particular script just sends an e-mail to an account when the &#8216;doorbell&#8217; is rung, but you could have it do pretty much anything up to and including ringing a real bell (which may be coming soon!).</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
<span style="color: #808080; font-style: italic;"># encoding: utf-8</span>
<span style="color: #483d8b;">&quot;&quot;&quot;
doorbell.py
Created by Hilary Mason, feel free to use this code in your own projects.
&quot;&quot;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>, <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">smtplib</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">cgi</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">cgitb</span><span style="color: #66cc66;">;</span> <span style="color: #dc143c;">cgitb</span>.<span style="color: black;">enable</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Doorbell<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
	GMAIL_USERNAME = <span style="color: #483d8b;">'YOURGMAILACCOUNT@gmail.com'</span>
	GMAIL_PASSWORD = <span style="color: #483d8b;">'YOURPASSWORD'</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, msg<span style="color: black;">&#41;</span>:
		message = <span style="color: #483d8b;">&quot;&quot;&quot;<span style="color: #000099; font-weight: bold;">\</span>
From: YOURGMAILACCOUNT@gmail.com
To: YOURGMAILACCOUNT@gmail.com
Subject: KNOCK KNOCK, someone is at the door!
&nbsp;
%s
		&quot;&quot;&quot;</span> <span style="color: #66cc66;">%</span> msg
&nbsp;
		server = <span style="color: #dc143c;">smtplib</span>.<span style="color: black;">SMTP</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'smtp.gmail.com:587'</span><span style="color: black;">&#41;</span>
		server.<span style="color: black;">ehlo</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
		server.<span style="color: black;">starttls</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
		server.<span style="color: black;">ehlo</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
		server.<span style="color: black;">login</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">GMAIL_USERNAME</span>, <span style="color: #008000;">self</span>.<span style="color: black;">GMAIL_PASSWORD</span><span style="color: black;">&#41;</span>
		server.<span style="color: black;">sendmail</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'YOURGMAILACCOUNT@gmail.com'</span>, <span style="color: black;">&#91;</span><span style="color: #483d8b;">'YOURGMAILACCOUNT@gmail.com'</span><span style="color: black;">&#93;</span>, message<span style="color: black;">&#41;</span>
		server.<span style="color: black;">quit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
		<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;You knocked! You can also call us at 347-586-9270. &lt;3, NYC Resistor&quot;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:
	<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Content-Type: text/plain<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
&nbsp;
	form = <span style="color: #dc143c;">cgi</span>.<span style="color: black;">FieldStorage</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">'msg'</span> <span style="color: #ff7700;font-weight:bold;">in</span> form:
		w = Doorbell<span style="color: black;">&#40;</span>form<span style="color: black;">&#91;</span><span style="color: #483d8b;">'msg'</span><span style="color: black;">&#93;</span>.<span style="color: black;">value</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">else</span>:
		w = Doorbell<span style="color: black;">&#40;</span><span style="color: #483d8b;">'There is an anonymous monkey at the door.'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>And that&#8217;s it! Provided you have your keyword configured to point at your script, and the script living at an accessible address, you&#8217;ll get an e-mail whenever your SMS doorbell is rung and the person who sent the message will get back a cute response confirming their action.</p>
<h3>Finally&#8230;</h3>
<p>This setup can be easily extended such that a message containing &#8216;doorbell hilary&#8217; could e-mail only me, or be forwarded to my phone.  </p>
<p>I&#8217;m curious to see if having a remotely accessible &#8216;doorbell&#8217; will encourage pranksters &#8212; we might need to add a password.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hilarymason.com/blog/sms-to-e-mail-gateway-the-sms-doorbell/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Mobile app: WHEREAMI &lt;username&gt;</title>
		<link>http://www.hilarymason.com/blog/mobile-app-whereami/</link>
		<comments>http://www.hilarymason.com/blog/mobile-app-whereami/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 23:15:42 +0000</pubDate>
		<dc:creator>Hilary Mason</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[textmarks]]></category>

		<guid isPermaLink="false">http://www.hilarymason.com/?p=189</guid>
		<description><![CDATA[WHEREAMI is a mobile application that accepts a username as input, searches public profiles on various location-aware services, and returns the user&#8217;s last known location via text message.
Just text 41411 with whereami &#60;username&#62;, where &#60;username&#62; is a username that you or someone you know is likely to use.

For example, if you text whereami hmason to [...]]]></description>
			<content:encoded><![CDATA[<p>WHEREAMI is a mobile application that accepts a username as input, searches public profiles on various location-aware services, and returns the user&#8217;s last known location via text message.</p>
<p>Just text 41411 with <span style="font-family: Courier,monospace;">whereami &lt;username&gt;</span>, where &lt;username&gt; is a username that you or someone you know is likely to use.</p>
<p><img class="size-medium wp-image-192" style="float:left;margin-right:15px;" title="whereami_hmason" src="http://www.hilarymason.com/wp-content/uploads/2008/10/whereami_hmason-207x300.png" alt="results of WHEREAMI hmason" width="207" height="300" /></p>
<p>For example, if you text <span style="font-family: Courier,monospace;">whereami hmason</span> to 41411, you&#8217;ll see a response much like the image to the left.</p>
<p>This app works on the principle that people tend to use the same username for many applications. The WHEREAMI script will search through a variety of web services for a result for that username. All of the information is public and available without logging in.</p>
<p>Right now, the script will search <a href="http://www.brightkite.com">Brightkite</a>, then <a href="http://www.dopplr.com">Dopplr</a>, and finally <a href="http://www.twitter.com">Twitter</a>. If you know of another site with public user location information, please comment below and I&#8217;ll add it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hilarymason.com/blog/mobile-app-whereami/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Firefox Extension: Open Tab Count 1.0</title>
		<link>http://www.hilarymason.com/projects/firefox-extension-open-tab-count-10/</link>
		<comments>http://www.hilarymason.com/projects/firefox-extension-open-tab-count-10/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 03:56:16 +0000</pubDate>
		<dc:creator>Hilary Mason</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.hilarymason.com/?p=176</guid>
		<description><![CDATA[

How many tabs do you have open in your browser right now?
Did you have to count manually? Are you using Firefox? Try the open tab count extension!
I created this extension because I wanted to explore memory management in browser tabs, and I was curious about the Firefox extension architecture. I&#8217;m not quite as eager to [...]]]></description>
			<content:encoded><![CDATA[<div style="width:100px;float:left;margin:5px;font-size:80%">
<div id="attachment_180" class="wp-caption alignleft" style="width: 70px"><a href="https://addons.mozilla.org/en-US/firefox/addon/8363"><img class="size-full wp-image-180" title="Open Tab Count Extension" src="http://www.hilarymason.com/wp-content/uploads/2008/09/firefoxscreensnapz001.jpg" alt="Screenshot of the open tab count extension" width="60" height="58" /></a><p class="wp-caption-text">Open tab count extension in the status bar</p></div>
</div>
<p>How many tabs do you have open in your browser right now?</p>
<p>Did you have to count manually? Are you using Firefox? Try the <a title="open tab count extension" href="https://addons.mozilla.org/en-US/firefox/addon/8363">open tab count</a> extension!</p>
<p>I created this extension because I wanted to explore memory management in browser tabs, and I was curious about the Firefox extension architecture. I&#8217;m not quite as eager to explore memory hacks in Firefox now that Google Chrome is out and handles that issue natively, but I&#8217;m still using this extension to monitor my tab (over)usage.</p>
<p>The extension puts a small icon in the status bar alongside the number of open tabs. If more than one window is open, the extension shows the number of open tabs in the current window / the total number of open tabs.</p>
<p>Please let me know below if you have any comments!</p>
<p><strong>Update</strong>: An update has been submitted to Mozilla that supports Firefox 3.5, and <del datetime="2009-07-18T19:55:13+00:00">it&#8217;ll show up on the</del> it&#8217;s now available on the <a href="https://addons.mozilla.org/en-US/firefox/addon/8363">official extension page</a> <del datetime="2009-07-18T19:55:13+00:00">once it&#8217;s been approved</del>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hilarymason.com/projects/firefox-extension-open-tab-count-10/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>InfoFez: Information-based Navigation in Second Life</title>
		<link>http://www.hilarymason.com/projects/infofez-information-based-navigation-in-second-life/</link>
		<comments>http://www.hilarymason.com/projects/infofez-information-based-navigation-in-second-life/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 03:55:08 +0000</pubDate>
		<dc:creator>Hilary Mason</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[secondlife]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://www.hilarymason.com/?p=4</guid>
		<description><![CDATA[The new version of the InfoFez launches on April 7th&#8230; be there!
]]></description>
			<content:encoded><![CDATA[<p>The new version of the InfoFez launches on April 7th&#8230; be there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hilarymason.com/projects/infofez-information-based-navigation-in-second-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.283 seconds -->
