Writing, publishing, geekdom, and errata.

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

1 comment
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.




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

With CURL, here's how for


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.

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.)