Google URL Shortener (v1.x)

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! :]

20 Comments

  • November 19, 2012 - 3:37 AM | Permalink

    Awesome, it works like a charm. Thank you for building this great Alfred extension!

  • October 29, 2012 - 2:59 AM | Permalink

    Thanks! I was wondering why the script was prompting grep as the guilty.

  • john
    October 25, 2012 - 2:57 PM | Permalink

    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!

  • flackend
    October 17, 2012 - 5:39 AM | Permalink

    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 | pbcopy becomes echo -n $URL | pbcopy

    • Ken
      January 3, 2013 - 3:37 AM | Permalink

      Nice one! Without this change it would not work for me on Mountain Lion.
      Thanks!!

  • Roger Qian
    August 30, 2012 - 8:09 PM | Permalink

    Thanks, works flawlessly with notification centre too!

  • July 27, 2012 - 6:37 PM | Permalink

    I have updated this extension to work on Mountain Lion. Please let me know if you have any problems. Cheers!

    • ubersol
      July 28, 2012 - 7:44 PM | Permalink

      Perfect, working like a charm! Thanks.

  • Sax
    July 8, 2012 - 9:33 AM | Permalink

    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.

  • June 16, 2012 - 8:19 PM | Permalink

    Thanks for this. The other url shortener for alfred (I forgot the name) doesn’t work.

  • April 22, 2012 - 9:40 PM | Permalink

    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?

    • ubersol
      July 27, 2012 - 3:04 PM | Permalink

      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.

      • July 27, 2012 - 6:08 PM | Permalink

        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!

  • Deniz
    April 22, 2012 - 8:49 PM | Permalink

    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…

  • April 20, 2012 - 6:14 AM | Permalink

    Don’s extension doesn’t work right now, but luckily your extension still works well. :D

  • March 27, 2012 - 10:37 PM | Permalink

    thnx.. and your version has growl.

  • 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

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>