Users’ names and usernames
A few years ago my friend Jack built a cute little application. It was a text message multiplexer. You could send it a text message and it would send that message to all of your friends. You signed up using your phone number and gave it your name. It was somewhere between addictive and annoying but completely social, since basically all of the users were our friends. We mostly used it as a free-form Dodgeball, to work out when friends were out at bars and inevitably they added the ability to send a message directly to a contact. There were no usernames so twttr would cleverly work out who you meant based on the first name you supplied and your contacts list. This never worked right, they added usernames and now I'm @ian. Unfortunately then the whole @reply thing happened and people do just use their friends first names. Look at how many people use @ian - most of them are not talking to me, but other Ians.
Facebook resisted giving people anything other than a free-form name and a numeric user ID for the longest time. They finally gave in and let people pick vanity URLs but still refuse to make that URL useful for anything but getting to your profile. When they added @ support they pop up UI to autocomplete friends names from your contacts list. It works really well, but it depends on a rich message composition UI, something that's not possible on the simple mobile devices that twitter was targeting.
I wonder how the next site will approach this.
Twitter Translation
My friend Britt mentioned today that he was about to launch twitter.jp. How exciting! But I don't understand Japanese. If only I could easily translate all those tweets in languages I don't understand.
I played around with Google's new AJAX Translation API before and I wondered how hard it would be to use that from a GreaseMonkey script. The answer: hard. I'm not sure what the exact problem was but every way I tried to include Google's APIs into the pages I was manipulating, including creating my own iframe and using document.write failed. In the end I used a static proxy html file (hosted in one of my Amazon S3 buckets for cheap efficiency) with some sneaky cross-site communication (the request goes over in location.hash, the response comes back in window.name).
My script is now up on userscripts.org: twitlator.user.js
To use it simply go to a page listing a bunch of tweets, like the public timeline and find a tweet in a language you don't under stand. For example:

Click the translate! link and several moments later you've got:

Yep. People aren't posting anything interesting in Japanese either.
I'm pretty sure my script will only work on Firefox 3. I'm using getElementsByClassName which I think wasn't introduced until Firefox 3. Why aren't you running it already?
A simpler mobile OpenID workflow?
Chris Messina posted today about the problems with current OpenID work-flows for mobile users. In spite of a long list of chores I was intending to complete today I had a bit of an experiment with an approach to solving this.
The main problem I wanted to solve was to allow a user to prove their identity without having to enter a password. Most mobile devices lack physical alphanumeric keyboards, and without that it's very hard to fill out password fields.
The Making Of LOL Feeds
Last week I wrote and released my LOL Feeds site. It takes RSS or Atom feeds from the web and makes a series of lolcat-style images on a web page. It's really way funnier than it sounds.
Initially I wanted to be able to auto-generate Jerk City comic strips based on my friends' twitters, but when that seemed hard I opted for lolcats style images. After all we'd been seeing a lot of the lolcats on twitter - they're displayed when the site is undergoing maintenance.
The original version of the script was very very clever. It used the Google AJAX Feed API and the Flickr API to pull in feeds and random images of cats from Flickr, combine them together with a PHP script I wrote to generate transparent PNGs of text live onto the page. It used the browser's own text-flowing algorithms to lay out the text. It was however amazingly slow.
Browsers only allow a low number of concurrent connections to one site - four or eight I think - and this made the text crawl in. Also while the Google AJAX Feed API and Flickr API are pretty snappy they're way slower than doing it server side. I was sad about this because I'm kind of in love with fully dynamic client-side applications (just look at my home page) but I actually wanted this to see the light of day.
So a rewrite ensued. I pulled down a static set of cute cats from the cute cat group on Flickr, filtered by creative commons license of course. I removed a ton I didn't like and added a couple of pictures of cats I know well. I reworked the script that generated single words into one that could place words on a JPEG. I had to write my own text layout algorithms but it turned out to be pretty simple.
I used Magpie RSS to generate a page that referenced my image generation script. To make the image generation stable (so that everyone looking at the same feed would get the same images for the same text) the image is selected based on a hash of the message. Nothing is actually random.
Then I glued it together with a good helping of mod_rewrite
This version worked pretty well. There were some issues with non-ascii characters and even funny characters like ? and & due to some URL encoding issues but it worked well. I posted about it told some friends and waited to see what would happen.
Things were going fine till I hit metafiler. Dreamhost, my friendly cheap hosting provider (100% carbon neurtral - yay!) noticed my image generation script was slowing down my shared machine and turned it off.
Adding an image caching layer was pretty straight-forward. I turned the image generation script from a .php to a .inc and included it in my feed processing script. Instead of generating an image every time it generates an MD5 of image parameters and uses a cached image if one exists. I was able to update the existing image generation script to use the same code and send a redirect to the cached version. In the past 5 days the script has generated just over 50,000 unique images which have been accessed almost half a million times. That's a lot of cats saying stupid things. And a lot of saved CPU cycles.
I also wrote a Facebook Platform application, but that's a story for another day.
