RubyURL meets Zombies!
Last Friday, Greg Borenstein sent me a link to ZombieURL after it got launched. The folks at Bottlecap Labs took RubyURL and threw in Zombies… the rest you’ll have to see for yourself.
There… I warned you.
You can check out the source code for ZombieURL on GitHub
You can also grab the underlying source code for RubyURL on GitHub.
I’d love to see what other fun things people come up with to do with RubyURL.
Launch your own RubyURL 1
A few weeks ago, I moved RubyURL from subversion to git. During that process, I decided to use my invite to GitHub and have decided to go ahead and open up the source code.
It’s currently a whopping 92 LOC with a 1:2.5 code to spec ratio. (I had a goal to keep is below 100 LOC)
- RubyURL on GitHub: http://github.com/robbyrussell/rubyurl
- Public Clone URL: git://github.com/robbyrussell/rubyurl.git
Feel free to grab it and help contribute. This has served almost 14 million redirects since August 2007 and is running on a Rails Boxcar.
To grab it with git.. run: git clone git://github.com/robbyrussell/rubyurl.git.
Feel free to submit tickets to the Rubyurl ticket system.
Enjoy!
UPDATE Ryan McGeary was kind enough to be the first person to help track down a bug and submit patches. :-)
RubyURL through QuickSilver
When Chris Griffin saw this post, he wanted to do the same with RubyURL. Since the ShortURL gem was broken, I didn’t get a chance to dive into it. However, with the shorturl command now working again with RubyURL, we get QuickSilver and RubyURL working together really quickly.
First, you’ll need a recent version of the ShortURL gem installed.
sudo gem install shorturl
Then you will want to add the following to ~/Library/Scripts/rubyurl.scpt. You will need to create this file.
#
# Change accordingly if shorturl is not under /usr/bin/shorturl
#
set shorturl_cmd to "/opt/local/bin/shorturl"
tell application "Safari"
set original_url to URL of front document
end tell
set cmd to shorturl_cmd & " " & original_url
set ruby_url to do shell script cmd
set the clipboard to ruby_url as text
beep
Then you can add this script to run through QuickSilver. For details, jump to the setup process on this post.
This will make it much easier to paste RubyURLs into my Twitter client, IRC, etc.
I’ll try to post a more thorough tutorial soon, but wanted to share in the meantime.
ShortURL 0.8.4 released and gets a new mainainer... me! 2
Earlier today, Vincent Foley was kind enough to hand over maitenance of the the ShortURL project on RubyForge to me. He first released it back in 2005, which I blogged about as RubyURL was the first shortening service that it supported (and is the default). Unfortunately, the release of RubyURL 2.0 broke backwards compatibility and Vincent wasn’t maintaining it anymore. So, earlier, I decided to patch this and got a new version released that now works with the current RubyURL site.
While working on the code, I decided to extend the compatible services to include moourl and urlTea.
These updates are available in ShortURL version 0.8.4.
Install the ShortURL gem
Installation is a snap… (like 99.7% of rubygems…)
~ > sudo gem install shorturl Password:
Successfully installed shorturl-0.8.4
1 gem installed
Installing ri documentation for shorturl-0.8.4...
Installing RDoc documentation for shorturl-0.8.4.
Using ShortURL
The ShortURL gem provides the ShortURL library, which you can use from any Ruby application.
Using the ShortURL library
~ > irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'shorturl'
=> true
irb(main):003:0> ShortURL.shorten( 'http://www.istwitterdown.com' )
=> "http://rubyurl.com/P9w"
As you can see…it’s really straight forward.
Let’s try it with a few other services.
irb(main):004:0> ShortURL.shorten( 'http://www.istwitterdown.com', :moourl )
=> "http://moourl.com/fvoky"
irb(main):005:0> ShortURL.shorten( 'http://www.istwitterdown.com', :tinyurl )
=> "http://tinyurl.com/2t3qmh"
Using the shorturl command-line tool
Many people don’t know that ShortURL provides a command-line tool, which you can use after installing the gem.
~ > shorturl http://istwitterdown.com
http://rubyurl.com/Lwk
If you’d like to see more services provided than the ones listed here, please submit feature requests and/or patches on the rubyforge project.
ShortURL Documentation
To see the latest documentation for the project, please visit:
My favorite part about this? My rbot plugin for RubyURL works again!
Happy URL-shortening!
RubyURL bookmarklet 2.0 3
If you’re using the bookmarklet for RubyURL, you will want to update it with the latest version as there was apparently a bug in the JavaScript and some URLs would fail to redirect properly. Thanks to the help of Jerome, this is now fixed.
So, head over to RubyURL and update your bookmarket. Not sure what I’m talking about? Watch the video.
Older posts: 1 2







