Essays

2 years ago

Wednesday, November 21, 2007

Surly: Shortened URLs from Multiple Browsers and Services

Update: This script has been repackaged alongside its full-URL-grabbing counterpart, Furly, and has been given a permanent home in the Sakuzaku Goodie Basket. Please head over there to get the latest documentation for it.

In response to recent well-founded worries about URL-shortening services and inspired by John Gruber’s endorsement of Metamark, Dr. Drang posted a short script for getting the URL of the frontmost Safari window (or tab, as it were), shortening it with the Metamark URL-shortening service, and storing the result in the clipboard. Even better, it can all be done with a flick of the wrist in Quicksilver.

Awesome, but I don’t use Safari. So I created some scripts to generate either a TinyURL or Metamark URL for your clipboard that works with your default browser. The scripts currently support Safari, Firefox, Camino, and Opera.

Or, grab them all in one easy-to-download package:

Installation

  1. Download the Surly & Furly collection.
  2. Move the scripts you want to somewhere out of the way, but where Quicksilver can find it. Dr. Drang recommends your home directory, but if you like to keep your directories clean, you can put it in ~/Library/Scripts, which Quicksilver will index automatically if you’ve enabled the “Scripts (User)” catalog item in the “Catalog” section of your Quicksilver preferences. After a re-scan of the Quicksilver catalog (which you can force by activating QS and running ⌘+R, the appropriate scripts should be available.
  3. Activate Quicksilver and call up your script. If you want to create a TinyURL from your browser’s frontmost URL, for example, typing TinyURL should find TinyURL.scpt (if Quicksilver has figured out where you’ve stored it). Just hit Enter, and after a few seconds your shortened URL will be in the clipboard. Note that Metamark seems to take a few seconds more than TinyURL, but you shouldn’t need to wait more than 2 or 3 seconds for either of them.
  4. Paste away!

Questions, Comments

I will modify and create scripts for other URL-shortening services and browsers upon request by email. Also, don’t hesitate to send bug reports — you might get a Sakuzaku pin badge for your trouble.

Acknowledgements

Inspiration for these scripts is owed to the aforementioned Dr. Drang, to whom I extend many thanks. (If you’re writing about webpages, Dr. Drang’s furl script for getting full URLs is a great companion to Surly.) Thanks also to Daniel Bogan of Waferbaby, who provided testing and debugging.

Trackback Comment

Thanks - this is great. Was having trouble using the other one with Firefox.

God damn I love Quicksilver …

Wednesday, March 10, 2010
05:30pm