Scripting News, the weblog started in 1997 that bootstrapped the blogging revolution.
 

Home > Archive >  2009 >  August >  25

How to fix URL-shorteners, part II

Tuesday, August 25, 2009 by Dave Winer.

Last Wednesday I wrote a piece that explained how to fix URL-shorteners. Today, with the help of Joe Moreno at Adjix, I implemented it. A picture named sidesmiley.gif Permalink to this paragraph

Here's how my new URL-shortener works. Permalink to this paragraph

1. Joe is running the shortener at adjix.com. It's the same one he's always been running, but it's got a few new features. Permalink to this paragraph

A picture named mao.gif2. In the prefs for Adjix, I told it that I wanted to use my own domain, c.oy.ly. I also told it to write copies of all my shortened URLs to a bucket at Amazon, which I had given his app permission to write to. By using my own domain, one which I control the DNS for, and retaining a copy of all the data, I am fully protected against his service going away. And I can decide at any time to take over hosting of my own short URLs by directing the c.oy.ly domain to s3.amazonaws.com instead of partner.adjix.com.  Permalink to this paragraph

3. When I create a shortened URL, I do it by calling an API routine that works exactly as the APIs of the other shorteners. I give it the long URL, some identifying information so it knows to associate it with my Adjix account, and it returns a token, which I smash together with http://c.oy.ly/ to form the shortened URLPermalink to this paragraph

4. All this is done with a bookmarklet communicating with a web app on one of my servers. It then takes the title of the page I'm linking to and adds the full URL from step 3, and redirects me to twitter.com, where I can edit the tweet before clicking on Update.  Permalink to this paragraph

5. Then, every few minutes I call the Twitter API and ask if Dave has posted any new tweets. If so, I parse them, store the long and short versions of the URL in my database (by dereferencing the URL). Then I call a second API on Adjix to ask it to give me the counts for the most recent 50 links created by Dave. I then update the counts in my database, sort them, and prepare the familiar Top-40 report.  Permalink to this paragraph

Bottom-line: I am now using URL-shorteners in a way that does not make the Internet suck. I have done my good deed for the day! A picture named sidesmiley.gif Permalink to this paragraph




 
   Recent stories


A picture named dave.jpgDave Winer, 55, is a visiting scholar at NYU's Arthur L. Carter Journalism Institute. He pioneered the development of weblogs, syndication (RSS), podcasting, outlining, and web content management software; former contributing editor at Wired Magazine, research fellow at Harvard Law School, entrepreneur, and investor in web media companies. A native New Yorker, he received a Master's in Computer Science from the University of Wisconsin, a Bachelor's in Mathematics from Tulane University and currently lives in New York City.

"The protoblogger." - NY Times.

"The father of modern-day content distribution." - PC World.

One of BusinessWeek's 25 Most Influential People on the Web.

"Helped popularize blogging, podcasting and RSS." - Time.

"The father of blogging and RSS." - BBC.

"RSS was born in 1997 out of the confluence of Dave Winer's 'Really Simple Syndication' technology, used to push out blog updates, and Netscape's 'Rich Site Summary', which allowed users to create custom Netscape home pages with regularly updated data flows." - Tim O'Reilly.

http://twitter.com/davewiner



Dave Winer Mailto icon



© Copyright 1994-2010 Dave Winer Mailto icon.

Last update: 5/20/2010; 5:25:34 PM Pacific. "It's even worse than it appears."

RSS 2.0 feed.