Getting the most out of Lessn

September 23rd, 2009 | Tutorials

As I wrote about a little while ago, I’ve been using my own RLE.me URL shortener, powered by Lessn (app install notes here, and info about the update here). If ridiculously hyper sentences like that aren’t convincing enough, linking and how we link is very important.

I have been loving Shaun Inman’s script so much that I was getting really miserly about how I was using the precious first 35 short URLs that have only one character (disappointingly symbols and capitalized characters aren’t used. I think that’s a function of base_convert). In fact, to make sure I’m using them wisely I just “reserved” the last 12 single character URLs for manual use, or maybe installing Lessn again under something like rle.me/x/ as the tutorial suggests, instead of in the root!

One great way to make sure you’re getting the most out of Lessn is to make sure you don’t shorten a URL more than once! It could happen so easily as I discovered. You get talking about a site or project, and you want to share the brilliantly shortened link. But what was that Lessn URL again? Then you waste time searching back… was it H? G? 5? It would be too tempting to shorten it again.

To solve this minor issue I wrote a page to be added to Lessn called listr.php. Listr basically digs into the database to list all the original URLs and the shortened URL.

listr

Installation

This couldn’t be easier to add to your Lessn install. Simply download the listr.zip file, uncompress it and FTP it to http://yourdomain.com/-/ Once you login and go to http://yourdomain.com/-/listr.php you will see all of the URLs you’ve shortened over time. Download Listr.zip

Note, this Listr page isn’t private, and anyone who browses to it will be able to see your list. I figure that’s fine, as anyone who can see your Short URL can guess the other short URLs. To make your Listr private include the “index.php” (which has session sniffing cookie action) and scrap the then redundant includes like config.php and db.php. You can then also remove the defines on LESSN_URL and LESSN_DOMAIN.

The results are listed in a table which you can customize. For instance you might not want your ID column, and you might want the short URL to be a link (I commented this out).

Note, I’m not a “PHP Poet” so maybe some of the server calls and code could be made more elegant. Maybe pagination or search will become an issue once you’ve had Lessn installed for a while. If you make some improvements please let me know, I’d love to share it here.

15 Responses to “Getting the most out of Lessn”

  1. Great work… nice to be able to keep track of your already-shortened URLs. Here’s a suggested style change: http://pastie.org/629556

  2. ArleyM says:

    Epic! Thanks Jesse, I have updated the file in the zip. I also added an ORDER BY in the SQL select.

  3. Scott says:

    Great script Arley! Thanks for sharing it as well!

  4. [...] also uploaded a nifty little add-on from Debut Creative called Listr which lists all the original URL’s plus the shortened URL in a table so you can review the [...]

  5. Abraham Vegh says:

    This is an awesome addition to Lessn, but re-shortening the same URL will return the original shortcode, not a new one.

  6. ArleyM says:

    I guess I never tried and assumed!

    Still, I have used Listr countless times – often when I forget both URLs, but remember bookmarking it.

  7. Does anyone have any idea why I would be getting a 404 on this page when it’s been uploaded?

  8. So I got all jumbled up with my FTP accounts and was just uploading it to the wrong directory. HA!

    Works great. Thanks man :)

  9. Erica K. says:

    Great idea! To simplify even further I added an include pointing to listr.php at the bottom of /-/index.php so it automatically loads the already shortened urls without me having to go anywhere special. I suppose you could include a link to the list if you didn’t want it showing up every time as well. :)

  10. It’s a shame you don’t have a donate button! I’d most certainly donate to this brilliant blog! I guess for now i’ll settle for
    bookmarking and adding your RSS feed to my Google account.
    I look forward to brand new updates and will talk about
    this blog with my Facebook group. Chat soon!

  11. Even French politicians don’t get laid as much as 350 skin whitening home remedies for dry skin calories higher each day. Apply on to face for 5 to 10 minutes.

  12. Umm, could I have easier to understand version of this post?
    lol

  13. tips says:

    Whats up are using WordPress for your blog platform? I’m
    new to the blog world but I’m trying to get started and set up
    my own. Do you need any coding knowledge to make your own
    blog? Any help would be greatly appreciated!

    Here is my weblog: tips

  14. Hey there! I know this is somewhat off topic but I was wondering if you
    knew where I could get a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having
    trouble finding one? Thanks a lot!

Leave a Reply