• Songwriter, Recording Artist, and Blogging Musician
  • Log in
  • Help

How To Shorten URLs With Bit.ly Using Quicksilver

Quicksilver BitlyA URL shortener service called Bit.ly launched today. It has some great features that convinced me to switch from using Metamark to shorten my URLs. Since I have a slick script that allows me to use the Metamark API from Quicksilver, I had to modify the code to make it work with Bit.ly.

Copy the following script, name it what you want, and save it in your home folder. When you want to shorten a URL in Safari, run the script from Quicksilver and it will put the shortened URL on your clipboard, ready for pasting.

#!/usr/bin/env python

usage = '''
Takes the URL of the frontmost Safari window/tab and
shortens using the service at bit.ly. The shortened
URL is put on the clipboard, ready for pasting.
'''

from urllib import urlopen, urlencode
from os import popen

# Get the URL of the frontmost Safari window/tab though AppleScript.
applescript = '''tell application "Safari"
URL of front document
end tell'''

url = popen("osascript -e '" + applescript + "'").read().strip()

# Get the shortened URL from bit.ly.
shortURL = urlopen('http://bit.ly/api?url=' + url).read()

# Put the shortened URL on the clipboard.
popen('pbcopy', 'w').write(shortURL)

If Firefox is your thing, modify the AppleScript tell to:

applescript = '''tell application "Firefox"
set myFirefox to properties of front window as list
get item 3 of myFirefox
end tell'''

Update: I also use the following script as a Quicksilver trigger to expand shortened URLs and protect myself from surreptitious rickrolling. Just copy the shortened URL you want to expand (TinyURL, Bit.ly, etc.) and trigger the script.

tell application "Quicksilver" to show large type (do shell script "curl -Is `pbpaste` | grep Location | awk '{print $2}'")

If you want to be notified the next time I post something, sign up for email alerts or subscribe to my RSS feed. Thanks for visiting!

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

The Best Of Graham English 2007

2007It’s time for my yearly reflections and celebrations.

By far the most popular and most controversial post of 2007 was The Zen Of Attraction. I’m surprised at the attention it received because I wrote it as an aside. Some people loved it and some people hated it. But what was most interesting for me was how many people hated not the article, but me. I mean these were just simple ideas that are totally debatable. This post led me to define some comment rules that include no personal attacks. I’m willing to debate ideas but not whether I’m a good person or not. It was a very interesting experience!

The second most popular post was iQuickTwitter - My Quicksilver + Twitter + iChat + Growl Hack. This little app got some serious link love from TUAW, Ars Technica, and many other fantastic blogs. And a big reason why I didn’t blog as much as I did in 2006 was because of Twitter. If I ever had something short and simple to say, rather than try to develop it into at least 250 words, which I previously believed warranted a blog post, I would just post it to Twitter, which has a limit of 140 characters. I think my strategy will change some in 2008. My new Lifestream category will probably see a lot more action whenever I find that 140 characters is not enough. The most significant change is that I won’t keep such a tightly controlled niche blog. The only thing tying this blog together is that I am writing it, not the subject matter. So if I feel like saying something, this blog will take priority.

Along similar lines as iQuickTwitter were my many posts on . Some of them were conceptual, like Automation As Part Of An Integral Life Practice and Automating The Quality Of Your Attention. While others were specific and geeky, like IM Status: Update Your Skype, iChat, Or Adium Status With Quicksilver, Top 5 AppleScript Productivity Hacks for WordPress Bloggers and Podcasters, and Blogging With Quicksilver And AppleScript. I’ve really grown to see automation as an important part of life that I need to revisit again and again.

Some of my favorite songwriting articles were Applying The 80-20 Rule To Your Songwriting, my Hit Songwriting Tips Podcast, The Secret Alchemy Of Songwriting, 5 Sure Fire Ways To Kick-Start The Songwriting Habit, Rewriting Song Titles For Practice And Inspiration, and What Makes a Good Song? My biggest disappointment of 2007 was the small amount of completed songs. I finished only about half a dozen songs and published just one of them, which I’m quite proud of, “When The Wall Falls Down.”

I also didn’t write about ear training or music theory nearly as much as I did in 2006. But I have a few favorites, such as How To Use Tension And Release In Your Melodies, my Absolute Pitch Ear Training Podcast, Playing Outside: The Dominant 7 Pentatonic Scale, and Ear Training or Listening Practice?

Two great moments of 2007 were getting my new MacBook Pro and iPhone. The new Mac inspired a whole new series of podcasts called Graham English Talks and introduced my own videos, like The Best Of Dwight Schrute Part 1, Part 2, and Part 3. The iPhone inspired Brian Eno’s Oblique Strategies For Your iPhone and made my tech life much more streamlined.

2007 was definitely a year of . Twitter, Facebook, Last.fm, Stumbleupon, and many other social networks occupied a large part of my time online. And there were many benefits like making new friends, reconnecting with old friends, finding a larger reach for my articles and music, and discovering new forms of self-expression. It confirms how important relationships truly are.

Which leads me to the very best of 2007, You! My life wouldn’t be nearly as fulfilling without the special presence of you. The support of my readers and listeners has made the tough times easier and the good times even better. I sincerely hope that we stay connected through 2008. Thanks for sticking with me through 2007. w00t!

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.75 out of 5)
Loading ... Loading ...

Update Twitter, Facebook, iChat, Adium, And Skype With Quicksilver

QuicksilverI’m a Facebook fanatic. I joined immediately after they opened to the public. In the beginning, there wasn’t much to talk about. None of my friends had joined and there really wasn’t that much I could do there. But since then, the buzz has caught my friends’ attention and Facebook’s extendibility has grown consistently, giving me a lot to play with.

Since I’ve been catching myself updating both Facebook and Twitter separately, I figured I should revisit my workflow and see if I can tweak my current level of automation.

It wasn’t difficult. I just added a couple lines of code to iQuickTwitter and now I can update Twitter, Facebook, iChat, and Skype with a single command. If you dig it, be my friend and let me know.
Graham English @ Facebook
Graham English @ Twitter

Click here to open the script in Script Editor.

If all you want is to update Facebook with Quicksilver, try this:
Click here to open the script in Script Editor.

If you try to please everyone, somebody is not going to like it.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5 out of 5)
Loading ... Loading ...

Brian Eno’s Oblique Strategies For Your iPhone

In an attempt to hack their creativity and artistic output, Brian Eno and Peter Schmidt created a deck of cards they called the Oblique Strategies. Whenever they came up against a creative dilemma–and especially while under a moment of pressure or deadline–they would pull a card and follow the directions.

I’ve used this technique constantly in my creative pursuits. Whether it be composing, arranging, or songwriting, the Oblique Strategies have helped to keep me in a state of creative flow.

I wanted to create a mobile version since I find myself sans computer a lot now that I have my iPhone. This online version of the Oblique Strategies will work on any browser even though it’s optimized for iPhone.

Check it out and bookmark it if you like it: Oblique Strategies

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...

Append To OmniOutliner Quicksilver Action

OmniOutlinerOne of my Twitter friends wished that you could use Quicksilver to append to an OmniOutliner document. This took me 5 minutes to whip up. I got the entire code from MacScripter and then wrapped it up as a Quicksilver action.

It’s pretty simple to use. Save it in your Quicksilver actions folder, restart Quicksilver, and give it a go. It lists the topics of your frontmost OmniOutliner outline and appends the text to your topic of choice.

Click here to open the script in Script Editor.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4 out of 5)
Loading ... Loading ...

© 2008 Graham English. Contact Subscribe Support

Close
Powered by ShareThis