Like any respectable person in this world, I don’t watch TV. But I do like some TV shows, so I watch them online or download them from various sources and watch them offline. Lately the number of shows I had to keep track of has grown substantially so I had a hard time doing it. (Actually, I’m just really lame and remembering 8 shows’ air dates is too big an effort for me)
So I had a few days off and I decided to build myself a little Adobe AIR app to help me out with my little problem. So without further ado, here’s the awesomeness of an application which I’ve dubbed “mrm’s TV Guide”:
Pretty Cool™, ain’t it? Yeah, I know. Now awarded with Softpedia’s “100% Clean” award!
So here’s how it works.
The application gets its data from TV Calendar, a really neat site that’s been around for a few years now. If I’d only find out about it sooner! TV Calendar also gets its data from epguides.com and TVRage.Com, so it’s not 100% accurate or up-to-date.
But my application doesn’t actually download anything from TV Calendar. Using the power of YQL (Yahoo Query Language) and XPath, web scraping has never beed easier. My application gets its data from Yahoo’s cache with an easy to use SQL-like SELECT syntax and a bit of XPath to filter just the relevant HTML tags. The result is return in JSON format, which is decoded to ActionScript objects using Mike Chambers’ as3corelib.
When you press the “Update” button, it’ll fetch all the shows airing this month, the shows that have aired in the past 4 months and the shows that will be airing in the upcoming 2 months (currently these numbers are hardcoded, but you will be able to change them in a future version). Then, for each day in those 7 months, it will load the corresponding TV Calendar page and extract the episode title, episode description etc for each episode it has found. The progress is reported using a simple progress bar as you can see in the image below.
As the information is loaded, the calendar is updated with the episodes from the shows chosen based on my filters. We’ll get to filters in a bit. When you first run the application there won’t be any filters, so all the episode dates will be highlighted in the calendar. The episodes for the current selected date will be displayed in on the right. If you hover your mouse over an episode, the summary will be displayed in a tooltip. Handy!
After all the data has been retrieved, the information is saved locally in an SQLite database so you can check your favourite shows offline.
Now, I was saying something about those filters… At this point, if you have no filters set up (that is, no show is checked in the “Filters” window), the “Filters” window will pop up where you can select the shows you would like to be displayed in the calendar. The “Select All” and “Deselect All” buttons are conveniently located at the top of the window for easy access. This window also accepts keyboard input, so for example if you press “H” the list will scroll to the first show matching the first letter. In this case, “Heroes”.
After you select your preferred shows, the calendar will be updated to reflect your choices. Here’s what I’ll be watching on the 20th of January 2009.
… And that’s a wrap.
PS: Don’t click the “Clear” button, unless of course you want to remove all shows and episodes data from the database .
UPDATE: You can now grab it from the Adobe Marketplace. SWEET!!
UPDATE 2: “100% CLEAN” award granted by Softpedia. SWEET!!