Saturday, August 18, 2007

Hendricks Solutions Web History

Google's web history application is quite useful. At least for Google searches. To expand web history beyond searches, one must install Google's Toolbar. I don't like browser toolbars and haven't installed Google's, so I only see searches in my history.

About once a month, I use search history to find a page I looked at earlier but am unable to track down again through other means. As the first step towards getting a convenient, browsable history of my browsing, tonight I implemented Hendricks Solutions Web History.

It's just a simple Greasemonkey script that shoots off an XMLHttpRequest with the URI, timestamp and page title of the web page that just loaded. It looks something like this:

// ==UserScript==
// @name           Where have I been
// @namespace      http://www.ndrix.com
// @description    Submit an AJAX request registering every URI Firefox visits
// @include        *
// ==/UserScript==
var uri   = location.href;
var title = document.title;
var time  = Math.round((new Date()).getTime()/1000 );

var get_this = "http://www.example.com/foo.pl"
             + "?time="  + time
             + "&uri="   + encodeURIComponent(uri)
             + "&title=" + encodeURIComponent(title)
             ;
GM_xmlhttpRequest({
    method : "GET",
    url    : get_this,
    onload : function () { return },
});

On the server there's a small Perl script that collects that information and appends it to a log. Now I have a central repository of all the webpages I ever visit. Sometime I'll hack on a pretty front end.

SMS to HTTP Gateway

I've become quite enamored with Google SMS. It's given me some ideas for other useful SMS interfaces. SMS seems like a convenient way to implement a mobile command-line interface to useful server-side services. To make that feasible, I want a handy gateway that translates incoming SMS messages into HTTP POST requests. Here's roughly the way I want it to play out:

  1. I send an SMS to 123-456-7890
  2. The gateway receives the message
  3. The gateway POSTs the following to a URI of my choice
    • message content
    • originating phone number
  4. If the HTTP response contains text content, the gateway uses it as the body of an SMS reply to the original sender
  5. Otherwise, no SMS reply is made

Apparently this service is offered in Europe, but I haven't found anything equivalent in the US. A thread on webmasterworld discusses roughly what I want, but I didn't find anything useful from it. Any suggestions?

Wednesday, August 1, 2007

Deleting is Bad

We live in an era when disk space is so cheap that it takes more effort to delete something than to just let it sit around somewhere on my disk. For example, a client emailed me today asking whether such and such had happened. It happened sometime in May 2006, but I couldn't provide more detail than that. Because of limitations on my Palm Pilot, I have to purge my appointment book every so often to maintain decent performance. Were that not the case, I could have found exactly what they wanted (maybe I'll start archiving my calendar and to do lists in iCalendar files).

Gmail inspired me on this. Although I don't use Gmail for my email (since it doesn't support IMAP), I do have a copy of every email I've sent or received since 23 April 2005. Because of mutt's pattern language, I can find almost any email in that pile in less than a minute.

Ah, the wonders of modern technology. If your valuable data is being deleted, let me know. I think the design should be reevaluated.