Important note: This plugin only functions with Alfred 1.x. It will not work with Alfred 2.
gurl is an Alfred.app (version 1.0) extension written to quickly shorten URLs using Google’s goo.gl URL shortening service. You can download gurl v2.0 url shortener here (zip).
Update: It seems that Mountain Lion has a different version of grep than that available in Lion, and the new version breaks the gurl extension. I have put together version 2.0 of gurl to fix this issue. It has been rewritten to use PHP instead of relying on commandline tools.
Usage:

When you get a growl notification like this, your new goo.gl shortened URL is in your clipboard ready to be pasted!

Hope you find this useful! Enjoy.
Alfred extension: Download gurl v2.0 url shortener (zip)
On the other extension: I originally wrote this extension before I was aware that another goo.gl extension already existed. Oh well! :]


Home
20 Comments
Awesome, it works like a charm. Thank you for building this great Alfred extension!
Thanks! I was wondering why the script was prompting grep as the guilty.
very useful extension. is there a way to shorten the url and the short link be stored in your google account to see the analytics? all this assuming that you’re logged in into your google account in your browser.
thanks!
If you add the -n flag to your echo command it’ll remove the newline at the end of the string passed to the clipboard.
echo $URL | pbcopybecomesecho -n $URL | pbcopyNice one! Without this change it would not work for me on Mountain Lion.
Thanks!!
Thanks, works flawlessly with notification centre too!
I have updated this extension to work on Mountain Lion. Please let me know if you have any problems. Cheers!
Perfect, working like a charm! Thanks.
Thanks! The other one uses “http://goo.gl/action/shorten” instead of “https://www.googleapis.com/urlshortener/v1/url”. The former worked for a long time, but since a few months or so it doesn’t return anything anymore.
Thanks for this. The other url shortener for alfred (I forgot the name) doesn’t work.
Hey guys! I’m glad you like the extension.
I’m not sure why it would stop working.. it still works for me. Are you getting any errors or indications of what’s wrong?
I think it has something to do with the usage of grep. Your’s and the other one gives me the exact same error when I use it in command line. See below:
./gurl.sh https://www.machine-unix.com/2012/07/image-jpg/
usage: grep [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
What I did was just to copy the contents of your extension into gurl.sh and chmod’ed it. ( chmod +x gurl.sh ). when executed as above grep complains about it. Running this on Mountain Lion and previosly on Lion. Same issue.
I believe you are right, ubersol. It looks like the -P flag isn’t working in the version of grep on Mountain Lion. This is pretty strange, since I believe both versions of OS X have the same versions of grep. I will confirm this when I check my machine at the office (still Lion).
Regardless, I’ll fix this and post a new version shortly!
Hey Just wanted to let you know, and I hope it is just me but your extension suddenly stopped working for me couple days ago. Very useful extension though…
Don’s extension doesn’t work right now, but luckily your extension still works well. :D
thnx.. and your version has growl.
I hope you find this helpful! :]
Pingback: Stop the Presses: Alfred Hits 1.0 | Design City
Pingback: Stop the Presses: Alfred Hits 1.0 | Apple World
Pingback: Stop the Presses: Alfred Hits 1.0 | Mac.AppStorm