For those of you using Shaun Inman’s Lessn, a personal url shortener, and Tweetie 2.0 on your iPhone, I’ve come up with a bookmarklet and some code that let’s you shorten a url with your Lessn installation, then have Tweetie open up a new status update containing the newly shortened url.
If you’re interested, the first thing you have to do is add some php code to your existing Lessn installation. In the index.php file in your /lessn/-/ directory just below the if(isset($_GET['tweet']){..} statement, your going to want to add the following code snippet:
if (isset($_GET['tweetie']))
{
$_GET['redirect'] = 'tweetie://post?message=%l';
}
This code must come before the if(isset($_GET['redirect'])){..} line so the application can properly call Tweetie on your iPhone.
The next step is set up the bookmarklet for your iPhone:
javascript:location.href='http://[domain.com]/[lessn]/-/?tweetie&url='+encodeURIComponent(location.href);
Obviously, you will want to replace [domain.com] and [lessn] with your own domain name and the name of the directory containing your Lessn installation. For example, mine looks like this:
javascript:location.href='http://manasto.info/u/-/?tweetie&url='+encodeURIComponent(location.href);
From now on, when you invoke the bookmarklet, Tweetie will open up a new status update containing the newly shortened URL.
Note: There is another way to do this, which I believe includes installing Tweetie’s own bookmarklet and setting up the app to use a custom url shortening end-point. That would be a different approach, but with the exact same end results.