Open Favorite Tweets on the Desktop

I’m a big fan of, but one thing I missed was the ability to take actions on Favorite Tweets. This was a limitation in the Twitter API, but they’ve just restored this feature, which means I’ll be actually using Twitter again.

What I was doing before was using IFTTT to email me any links in Tweets that I favorite. I use this when I’m using Tweetbot and see an article that I want to read later. Sure, there are services like Pocket, but I seldom use them. And emailing them to myself is fine, but it too is tedious. So I set out to make this a little more automated. Turns out this is pretty simple.

Here’s the IFTTT recipe:

IFTTT Recipe: Open link tweets on my Desktop

This recipe just saves the link in the tweet in a text file in ~/Dropbox/IFTTT/Desktop. Running cat $file | xargs open will open it in the browser. You see where this is going?…

Next, I created a Folder Action Script using the AppleScript Editor. AppleScripts tend to be a black whole, IMHO, so I immediately pass off the AppleScript to a simple Bash script. Yes, its probably possible to do this in AppleScript. I don’t care. If you get it working, I might care, but probably not. You can see the AppleScript and the Bash scripts in this gist:

Four things you’ll need to do:

  1. Copy the applescript to ~/Library/Scripts/Folder Action Scripts
  2. Copy the shell script to ~/bin and make executable with chmod +x
  3. Attach the Folder Action. In Finder, right-click on ~/Dropbox/IFTTT/Desktop (make it if its not there) and select Services –> Folder Actions Setup… With your AppleScript in ~/Library/Scripts/Folder Action Scripts, your script should appear in the list. Activate it, and make sure that “Enable Folder Actions” is checked at the top of the box.
  4. Profit

Once you’ve set it all up, go favorite a tweet and watch your life fall into place.

UPDATE: I created another recipe, and refactored this a bit so that you can use the same script with a bunch of different services. Here’s another recipe that does the same thing when I star an item in the iOS app Reeder, using the Feedly service:

IFTTT Recipe: Open Starred Items on my Desktop

If This Then That

This one isn’t unique to sysadmins. But as a sysadmin, you have a lot of online accounts that sit in silos across the web. Silos are bad. Imagine if you could someone get all of those accounts talking to one another so that something you do in one silo triggers something else in another silo.

Enter If This Then That

This is one of those genius concepts that most of us saw and immediately said to ourselves “Why didn’t I think of that?” and “Why has it taken mankind this long to come up with something this perfect?”

Confidence in mankind has been restored.

Some terms:

  • Channels – these are the online accounts you want IFTTT to use.
  • Tasks – connecting A to B is done with a task. For example, if I star an item in Google Reader, IFTTT sends me an email with the link.
  • Recipes – these are just Tasks you’ve made public for the rest of the world to use.

After setting up some Channels, you can start creating Tasks to get your accounts to do what you want them to do. You don’t have to write any code, read any API docs, or anything else. When I get tagged in a photo on Facebook, it adds it to my Flickr account. Another task copies it to my Dropbox.

Here’s one I’ve been using recently: if I star something in Google Reader (which I normally do from the Reeder app on my iPhone) send me the link in an email.