Update: The information below is about TV Forecast version 2.3.5. Since I wrote the post below, Matt Comi released an official fix, namely version 2.4, which now use TVRage.com as its data source. You should use TV Forecast official releases (1st link below), instead of trying to hack an old widget’s code like I did below.
TV Forecast is a nice widget that Matt Comi created. You tell it what TV shows you watch, and it will keep track of the upcoming episodes for those shows.

The only down side to that widget is that it data-scrape TV.com to get its data.
Not only is this illegal, but it also tends to break the widget every time TV.com change their layout in any way.
Getting tired of that, I decided to open the widget’s code, and change the data source to something more stable: TheTVDB.com
They provide a quite stable API to query their database, which is user-maintained.
TVRage.com has something similar, but my eyes hurt each time I go on their site, so I picked TheTVDB for now!
Update: Another good reason to pick TheTVDB over TVRage at this time: TVRage XML feeds are currently unavailable.

TheTVDB offer a search service, so changing the search function of the widget was easy enough.
Fetching the next episode information was trickier.
The API doesn’t offer an easy way to do that. They only provide XML data of all the episodes of a show; this is quite a lot to download for a small widget, just to know what’s the next episode…
So I created a middle-man.
This data proxy queries the API for an answer, and will then cache the result for 24 hours (48 hours for not running series; 1 week for ended series), before it will refresh its information again.
That way, each client running the widget can query the data proxy, which can use cached informations to return answers very fast, and in a very efficient way.
Note that the files packaged below are still Matt Comi’s property. I do not pretend to now own them in any way. I redistribute them here to allow end users to continue using his nice widget until he has time to fix his widget himself.
So… want to fix your own TV Forecast widget? Here’s how:
- Right click ~/Library/Widgets/TV Forecast.wdgt and select Show Package Contents.
This in how this should look before you touch anything:

- Copy the files found in this archive one by one into the TV Forecast.wdgt directory. Do not attempt to copy the TV folder itself found in my archive, or you’ll remove necessary files from the widget.
i.e. You need to copy the files inside it, but not the folder itself.
There’s one new file (TvShowParser2.js) that goes in the TV folder, the rest are files I modified, so you need to overwrite the existing files with mine.
Here’s how it should look after copying the new files:

- Reload (Cmd-R) the widget, or remove then re-add it to your Dashboard.
- Remove and re-add all TV shows in the widget’s configuration.
For the curious ones, here’s the diff of all my changes, plus the code for the data proxy script used by the widget. Feel free to use that script on your own server, and edit TV/Functions.js to point to your version of the script. It requires PHP 5 and MySQL, among other things…
loading...
i'm on mac os 10.5.6
fix put on TV Forecast 2.3.5 in ~/Library/Widgets/TV Forecast.wdgt and ~/Users/Home/Library/Widgets/TV Forecast.wdgt
doesn't work, always "Retrieving forecast…"…
maybe from France…
however, nice try, TV.com is ugly …
anyway, thanks again !
I think you didn't correctly use the files.
My instructions weren't clear enough I think.
Re-download the original TV Forecast widget from Matt's site. Overwrite the widget you have on your machine.
(It should only be once, and that should be in your user's directory… Not in /Library/Widgets/ as this is where the system's widget are…)
Then follow the updated instructions. They should be much clearer now.
Cheers.
It work perfect !!!
Thanks for changes and explanations !
Thank you!!!!
Thanks!
However, it does not seem to be searching for today's airing shows… there are two of my shows on tonight (numb3rs and dollhouse) but the widget only shows episodes after today…
Indeed. Good catch. I fixed this.
You should now see the correct date for shows airing today.
All this without you needing to update the widget!
Hooray for the middle-man!
Why not use tvrage.com, while I agree that their design isn't exactly clean and pleasant they have all the information you could need.
Check:
http://www.tvrage.com/tools.php
http://www.tvrage.com/xmlfeeds.php
For the widget I believe all you need is a way to search for the show and this:
http://www.tvrage.com/quickinfo.php?show=24
I don't see what TVRage has over TheTVDB… So I picked one based on nothing really.
I checked the API of TVRage already, and saw it is very similar to the one provided by TheTVDB; it offers search for the TV shows, plus a XML URL that lists all episodes.
Implementing TVRage is not very hard after what I already did, but I'm not sure I see any point in doing so…
But for now, TVRage is 'down', so I can't use it, even if I wanted to:
http://www.tvrage.com/feeds/episode_list.php?sid=2930
returns the following message:
"Due to the million of requests a day, our current server is not able to handle this without causing tvrage.com to become slow, within 2 weeks TVRage will be moved to a new network hosted on serveral servers each 8 times stronger then the current one then the feed services will be public again"
Thanks for the TV Forecast assist!
tried it several times step by step but the widget is stuck at "retrieving forcast…"
Try to click on the refresh button on the widget. I had the widget to that upon first load too.
If that doesn't work, that probably means you didn't correctly copy the files. You can open Console.app, and look in the system.log what appears when you add the widget to your Dashboard, then try to force it to refresh.
Normally, widget JavaScript errors appear there.
thanks, all is fine now.
I forgot to remove and then re-add the shows.
Fix worked great except that it's forecasting all shows a day earlier i.e. Sunday's shows forecasting for Saturday etc.
That works fine for me, but I’m EST, as is the middle-man server. You're probably PST, and 11:39pm PST is past midnight EST, which would make Sunday's show appear 'Today'.
Try to change the Broadcast city to something else than what you have by default; change an EST city if a PST city is selected by default, and a PST city if an EST city is selected by default…
BTW, refreshing the widget now should display the right days, since both EST and PST are currently Sunday.
Note that all TV shows have an air date of: "YYYY-MM-DD 00:00".
My timezone doesn't seem to be the issue. Just as an example, Heroes says it aires on Sunday, South Park aires on Tuesday, and The Office aires on Wednesday; those are all one day off. It's not a matter of "today" or "tomorrow".
Did you try to change the broadcast city of the shows?

Do you have "Perform time zone correction" enabled in the options?
All those shows appear the correct days for me, and I'm using the same information you are, since the server cache responses, so it sent me what it last sent you.

I never had to change broadcast city settings before, but just as a test I switched them to Minneapolis and that seemed to do the trick.
As an even more curious test, I turned off time zone correction completely, and that also seemed to realign my shows to the appropriate days.
Does the data coming from TVDB already take account for the user's current timezone, and therefore TZC messes that up?
The thing is, all shows were scheduled for 0h00, for all users. If TV Forecast, knowing this is midnight EST, then TZ-corrects it, it would then appear as the previous day for you.
I implemented show times yesterday evening, so once you see show times appear in the widget, then you can try to re-enabled TZ correction in your options, and all should be fine.
It seems to be impossible to add TV shows like 'Lost' or 'Heroes'. The search results shows many options, but not the right one…
I can add those shows just fine. They appear as the 1st choice when searching for "lost" and "heroes". Make sure you don't have them already in your list, or they will appear greyed-out; you can't add the same show twice.
Thanks!
Works great, but still loading. BTW, I haven't seen times yet, but the dates and episode titles are now correct. Thanks for this great update!
As with Steve I'm not seeing any showtimes
I added show times yesterday evening.
Running shows should take 24h or less to get times starting then.
Will I need to redo the copying to get the showtimes to work?
No. Showtimes will appear by themselves; only server-side changes were required, so I changed the middle-man script, which the widget feeds on.
I didn't test it fully yet though. I will tonight.
Looks like I was wrong; some more editing is required to get air times working…
You need to change the TV/TvShowParser2.js file.
You can either do it manually, or just overwrite yours with the updated file found in this archive.
To do it manually, open the file in a text editor, and replace the following lines (near the bottom):
// TheTVDB doesn't support air times…
return false;
With those lines:
var air_time = this.showAirsNext();
return (air_time.getHours() != 0 || air_time.getMinutes() != 0);
Refresh the widget (Cmd-R after clicking once in the widget) to use the updated code, or remove and re-add the widget to your Dashboard.
Sorry for the hassle.
Searching doesn't work… For example, i'm entering 'house' to add House M.D., pressing 'Search', it's showing 'Searching…' and after few seconds backs to entered word with no results.
Search worked for everyone, so I doubt it's broken.
It can sometimes be pretty slow: up to about 10-15s to come up with results.
Try searching with the correct case. i.e. "House" not "house".
Not sure why, but it seems to work better.
It's strange, but now it's working. Also it's ok with 'uncorrect case'.
Possibly there're some troubles at TheTVDB.
Thank you.
Excellent work! You're a savior!
I followed your updated directions exactly, and the package contents now look the same as your screenshot, but it's stuck at "Retrieving Forecast…". I tried reloading the widget but nothing changed, and nothing was entered in Console's system log when I added the widget to the dashboard. I've tried uninstalling the widget and starting the process over again several times, but it never works. I know it's working for everyone else so I must be doing something wrong… any suggestions?
Thanks!
@Nina, @Mike:
Please compress (right-click, Compress…) your "TV Forecast.wdgt" found in Library/Widgets, from your home directory.
Rename it with your name in it, and upload it here:
http://pub.pommepause.com
Post the link you get in a new comment here.
I'll see what's wrong with your widgets.
(Did you remove & re-add the widget to your Dashboard? Did you remove and re-add all the shows form the widget's settings?)
Sorry about the delay… here's my link:
http://pub.pommepause.com/nina's+TV+Forecast.wdgt.zip
I tried readding it to the dashboard, and deleting all the shows again, but it still seems stuck. Thanks for your help!!
That widget seems to work fine here.
You’re able to search and select shows, but once added, you can’t get see them in the widget front pane?
What shows are you trying?
I see two requests coming from your computer on the server, for the show "Gossip Girl". Both were made around 14h30 today, and seemed to work fine… You should see the result to those queries on the Widget; i.e. that show should appear, with the next episode on the 16th.
I just tried reloading it again, and it's working now — no idea what I did differently this time. Thanks so much for all your help!!
I just can't get it to work. I downloaded the archive and replaced/added the files as described (twice), but can't get past the "Retrieving forecast…" stage. Any suggestions?
(Wow. Nina just beat me to it and said almost the exact same thing. Freaky!)
For some reason the widget when searching for shows does not come up with any reasults, basically i cannot add any shows, any ideas???
Be patient. See above; searches can sometimes take 60 seconds or so to return results!
Try in the mornings for faster searches.
Actually, I missed the part about removing and re-entering the shows. Unfortunately, even after I did that, the Search doesn't return anything, even when I use case-sensitive naming. I uploaded the widget archive here: http://pub.pommepause.com/TV_Forecast-Mike-wdgt.zip
Update: sorry, everything works now. I just didn't wait long enough. For me, it takes 45-60 seconds for each query to return search results. Took a LONG time to re-enter all my shows, but it's all good. Thanks a ton!
Yeah… Search can be very slow sometimes.
I think it depends on the load on the TheTVDB.com servers; mornings are usually much faster than evenings.
Yes!! Thank you!!!
One comment: Clicking on the name of the show takes you to the xml file from your dataproxy. Clicking on the name of the episode takes you to the episode summary. It would be nice if clicking on the name took you directly to the thetvdb.com page for that show.
I’ll let Matt Comi implement that fix in his official release.
Does he plan to?
I don't know; he never answered my emails. I know he read them, since he Twitted about my changes, but I don't know when/if he'll integrate my changes in the official release.
After you add all your shows, is there any way to back that up and be able to transfer the list of your shows to another mac? For backup purposes or even to run on two macs. Trying to stop from having to re-enter them all
Sure is.
Just copy the widget-com.mattcomi.widget.tvforecast.plist file from ~/Library/Preferences/ to the same folder on other Macs.
You’ll probably need to remove and re-add the TV Forecast widget from your Dashboard if it was open when you copied the file.