- Tiger Dashboard Widgets, and AutomatorI watch Saturday Night Live regularly, and I like to know if it's new or a repeat. This seemed like a good use for a Tiger Dashboard widget.<p>
I took a look at another widget and couldn't believe how simple they are to implement. A widget is just an HTML file, a CSS file, a JavaScript file, and some glue. All you really need is the HTML file, so you can create a widget with no code at all.<p>
I wanted a widget that has what's on http://www.saturdaynightlive.com as the text on the widget. I was thinking of various ways I could pull the HTML and parse it to extract what I wanted to show, when I remembered Tiger has this new thing called Automator.<p>
Automator lets you string together script style operations using a fancy GUI. Every application that exposes Automator tasks is listed in the GUI with all the tasks they support, and each task says what it accepts and what it outputs.<p>
I strung together four things:<p>
<ul>
<li>Get Specified URLs (fetches the URL)
<li>Get Text from Webpage (turns the URL into a text stream)
<li>Filter Paragraphs (returns just the paragraph I want)
<li>New Text File (saves it to a text file)
</ul>
So without having to write any script at all, I have a way of extracting the text I want from the page and saving it into a text file. It was a simple operation from there to get the text from the file and load it (using JavaScript) into the widget.<p>
Automator looks incredibly powerful, and very easy to get into. If you've got Tiger, spend some time playing with it.Thu, 01 Sep 2005 19:17:09 GMT