Use bit.ly from the command line (and browser!) with no frills

technology.pngYeah, so I loathe the bit.ly redesign. I want a simple url shortener, that at least has an option without flash, or bundles, or doozits.

So here’s to do it, crossplatform (mostly) with a tiny bit of hacking.

DEPENDENCIES:

EITHER:

OPTIONAL:

Your actual script to call all of this will vary somewhat by operating system.

With CURL, here’s how for

Windows:

Unix (and for that matter, other than using a different clipboard manager, it should about the same for OSX)

The python version is pretty similar – edit the python script to put your username and API key in that file, then call it like this with a separate script (note the editing needed for windows folks…)

The beauty comes with something like Applauncher. Install, and configure your external application like this:

NAME: bit.ly
PATH: Put the full filename to bashbitly or cmdbitly.bat as applies.
ARGUMENTS: &url;

It will then take whatever the current url is, and shorten it, and paste it back to the clipboard!

As I note in the comments for the scripts above, I don’t have a windows machine running right now, so if you find errors, comment below! (Also, try messing with the %1 bits; that’s probably where it’s going wrong.)

Popular posts:

  • Link Salad: References From The Digital Publishing Talk
  • I'm Supporting Banned Books Week at My Local Library... are you?
  • The Only Thing That Needs To Be Said About A Gay Character In Beauty And The Beast
  • It's not just a number: Performing pain in healthcare
  • One Week Until CONTEXT
  • Not really a review, but some thoughts on Unbound and Jim C. Hines
  • Room Service - Published at the WiFiles

One Comment

Comments are closed.