I am most definitely a devotee of the social-networking message service Twitter (twitter.com). And while I’ve tried most of the Twitter apps for the Mac, I keep coming back to The Iconfactory’s Twitterrific (free with ads, $14.95 [£9] without; www.iconfactory.com). For people who don’t use Twitter, I’d need to write another story to explain its appeal.
For people who do, and who use Twitterrific to keep track of it, I’d like to point out some interesting hidden features of this Twitter app.
During the run-up to last year’s US presidential election, I got tired of all the political arguing in my Twitter feed. Twitter’s 140-character limit can kill nuance; to me, any political conversation worth listening to requires nuance. I decided I’d rather not see tweets that mentioned the candidates.
Fortunately, I didn’t have to resign from Twitter to get away from the politics. Instead, I used Twitterrific’s little-known text-filter feature, which is accessible only via the command line (or through a handy preference utility such as Blacktree’s Secrets [secrets.blacktree.com]).
Twitterrific’s text filtering uses the grep pattern-matching syntax. (To find out more about grep, see macworld.com/0578 or, better yet, get Jeffrey EF Friedl’s excellent book Mastering Regular Expressions [O’Reilly Media, 2006; oreilly.com].) To filter out mention of the candidates, we used the following Terminal command:
The first part of the command sets Twitterrific’s tweetTextFilter preference. The last part, in quotation marks, sets the filter. In grep, you use the pipe character (|) to mean the word or. So this command will eliminate tweets containing the words McCain or Obama.
Similarly, if you’d rather not see someone’s messages but don’t want to block that person, you can use the tweetScreenNameFilter setting following the same format:
Twitterrific has lots of other hidden preferences, all of which are documented in the Read Me file that accompanies the program. (You just haven’t lived until you’ve turned on sonicTwooshTechnology.)
Scripting your tweets
Want to annoy people by sending out Tweets automatically? You can do it with an AppleScript! Here’s the basic version of the script:
tell application “Twitterrific”
post update “I am a stupid, scripted tweet.”
Seriously, that’s it. Of course, you’ll want to tweak that basic script to do something more interesting.
For example, I wrote a script that allowed me to boast to people in other parts of the world about the wonderful weather we have here in the San Francisco Bay area. That script queries my home weather station (macworld.com/4926) for the current temperature, converts the temperature from Fahrenheit to Celsius, rounds both temperatures to the nearest degree, and then sticks the entire thing into one ridiculous weather boast (macworld.com/4927).
I stored that as a script that I can double-click on to run whenever I feel the need to lord it over people who could afford houses much larger than mine by living in places where it snows. It’s amazing that I still have any Twitter followers at all.
With a little AppleScripting, you can filter Twitterrific feeds by keyword or user, send out automated tweets, or have your Mac speak incoming messages
Scripting received tweets
You can also write an AppleScript script that will react to incoming Tweets. For example, recently Bob LeVitus (twitter.com/LeVitus) pointed out that he was following TalkingMoose (twitter.com/TalkingMoose) on Twitter. For those of you who aren’t old and decrepit like Bob and me, Talking Moose (macworld.com/4928) was a Mac program that would randomly pop up and say something funny or crazy – yes, a talking moose on your Mac screen.
Now someone has ported Talking Moose to Twitter – which made me wonder: what if I could get the TalkingMoose Twitter stream to speak out loud in the style of the old Talking Moose program? How useless would that be? So of course I wrote a script to do just that (see “talkingmoose.scpt” below).
After saving that script in my home folder, I went back to Terminal and entered the following command:
That’s it. After I quit and relaunched Twitterrific, my script executed every time a new tweet arrived. If the tweet was from TalkingMoose, my Mac read it out loud in MacinTalk’s Fred voice.
Please note that if you’re using an early version of Twitterrific, a bug will cause every tweet to be spoken every time a new tweet loads. So be sure to download version 3.2 (www.iconfactory.com) before running a script like this.
Also, be sure to read the program’s Read Me file all the way to the bottom. You’ll be amazed at what you find.
Jason Snell’s weather is probably nicer than yours. If you can stand it, follow him on Twitter as jsnell at twitter.com/jsnell. And for all the latest Mac news, views and rumours follow Macworld UK at twitter.com/macworlduk.