Saturday, September 23

Syncing Podcasts with iPod in iTunes 7

I’ve just started taking advantage of a new (?) feature in iTunes 7: you can sync podcasts to an iPod from one iTunes library, while the rest of the iPod is synced with another.

Here are the steps: Just plug in an iPod, cancel the dialog box that lets you transfer purchases or erase and sync, and click over to the “Podcasts” tab. From there, click the checkbox to enable syncing, heed the warning about erasing the old library’s podcasts from the iPod, and then press “Apply.”

Now, you can keep syncing music and such with the old iTunes library, but get podcasts from the new iTunes library.

I use this because all my music is on my primary computer, a laptop, but for convenience in the morning my podcasts are downloaded to an always-on Mac mini (the same used in my crossword printing workflow), outfitted with an iPod dock. Now I can get fresh podcasts without searching for my laptop and a connector cable, but my iPod can still be chock full of more musicy goodness than could ever fit on the mini’s drive. (Though with the TV shows I’ve been downloading — the mini is connected to the TV — this mini-sized hard drive has become quite appealing.)

Addendum: It seems that syncing back with the old library will delete the podcasts from the new library. No big deal, if you don’t mind waiting for them to be reloaded when you next sync with the new library.

Saturday, September 9

Downloading the New York Times Crossword with Automator

Wordplay got me into doing crosswords. If Jon Stewart, Bill Clinton, and the Indigo Girls are all into something (not to mention Ken Burns) I’d be crazy not to be all up on that. I bought the yearly online subscription to the New York Times puzzle and have been doing (attempting) it pretty much every day.

I made a workflow with Apple’s Automator to download each day’s puzzle from the Times’ website and print it out. If you’re in a similar position as I (you have the subscription, Across Lite, and Mac OS X 10.4) then give it a try: Print Crossword.workflow.

The overall workflow is pretty straightforward:
  1. Start with the New York Times crossword page URL
  2. Download the page, with proper authentication
  3. Find the URL to today’s puzzle
  4. Download today’s puzzle
  5. Open today’s puzzle
  6. Print today’s puzzle
There were two tricky bits at #3 and #6, which I had to solve using shell scripting and AppleScript, respectively.

While Safari scripting does a fair amount (I was happy it took care of using my NYTimes.com cookie for the authentication), it doesn’t handle #3, which actually surprised me. The task I needed is to get the URL linked to with the words “Today’s Puzzle.” Here’s the script I used:
grep -o "<a href=\"[^\"]*\">Today's Puzzle" $1 | sed -n -e "s|<a href=\"\\([^\"]*\\)\".*|http://select.nytimes.com/premium/xword/\\1|p"
rm -rf $1
Yeah, it’s a bit of a hack but it works. (If anyone has a better line, please leave it in the comments.) The grep is there to cut down on the data going in to sed, since sed will print out the unmatched start of the line (and matching the start with a regexp is too slow).

I was impressed with how simple it was to include a shell script in the workflow, given the typing going on. But “Files/Folders” became a path, and the stdout text became “URLs” for the next step. Neat!

Getting Across Lite to print the puzzle was the second tough bit. Across Lite is a reasonable program, but, as is often the case with ported software has no AppleScript support, so I had to fall back on GUI Scripting instead of the standard “print” command. Here’s the code:

on run {input, parameters}
set xfile to item 1 of input

tell application "Finder"
open xfile
end tell

tell application "Across Lite v2.0"
activate
end tell

tell application "System Events"
tell process "Across Lite v2.0"
click menu item "Print" of menu "File" of menu bar 1
keystroke return
keystroke return
keystroke return
end tell
end tell

tell application "Across Lite v2.0"
delay 10
quit
end tell

tell application "Finder"
delete xfile
end tell

return input
end run
Not too much to say here. Three returns to get through the print choices, Page Setup, and Print dialog boxes, and a ten second delay to prevent a crash.

And there you go! I saved this as an iCal plug-in and scheduled it to go off every day at 7AM. Though, to be truthful, I could probably turn it off for Fridays and Saturdays… But now every day when I wake up I have a crossword puzzle to take with me to do on the shuttle.

Monday, September 4

Feed Reader Feature Request

I was reading through maybe the third or fourth article in my feed reader about the MySpace music shop, thinking about how I really didn’t care about this particular story, and I didn’t want to read any more about it. Then, when I saw Tim O’Reilly’s piece on Google’s image-tagging game, I thought that it was interesting, and that I’d like to hear what other people have to say about it.

So I want two new operations in my feed reader. “No More!” would mark all other blog posts on a particular subject as read. “What’s All This, Then?” would dig up blog posts about the same subject from other blogs that I haven’t subscribed to.

“No More!” would help me deal with the incoming volume of news, and maybe put a few echo dampeners in the chamber. If my feed reader quickly cut out stuff I don’t want to see any more of, reading the news each day would be that much more enjoyable, since there would be that much less to wade through.

“What’s All This, Then?” would let me easily dig deeper into cool topics right from my feed reader, and help me find new blogs I might want to subscribe to. When I’m reading, I want to stay in the same app. I don’t want to go trawling through search engines to get more info, when everything I want is probably in the reader’s backend.

These two features come down to looking at one role of a feed reader as a — to coin a phase — canal of topics rather than a firehose of posts. My desire is to #1: hear the latest and #2: hear particular people’s take on such. If I don’t care about the story, then I don’t care what even the most insightful luminaries have to say on it. But if I am interested in the topic, give me anything and everything related to it.