It is currently Sat Nov 26, 2011 8:12 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: How to parse Shows.ted?
PostPosted: Sun Jul 26, 2009 4:38 pm 
Offline

Joined: Sat Jan 31, 2009 6:51 am
Posts: 8
I'm an enthusiastic fan of TED and a hobbyist developer. I recently started putting together a set of little tools that, overall, work with TED and uTorrent to fully automate the process of getting shows. I thought of some more stuff I'd like to do, like periodically sync the shows the user is watching with Google Calendar, so you can tell at a glance in your browser when new eps are coming up. I also would like to goof around with making some PHP scripting to potentially work with / control TED.

On my own I have managed to dupe out that Shows.ted is where the actual settings on which shows to watch are located, but I'm not really sure what to do to parse this file. Whats up with the contents of this file? Any tips on how I'd parse it into a nice string so I can play with it?

You guys rule!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 26, 2009 4:52 pm 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 5:46 pm
Posts: 904
Location: Netherlands
I don't think that will be very easy or even possible at all. If I remember correctly we write Java objects directly into the file. So you've to know how the TedSerie object looks like. And even then I'm not sure you can use this property to read the needed information.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 27, 2009 8:23 am 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 4:11 pm
Posts: 645
Location: Netherlands
Indeed, we stream Java objects (of the type TedSerie) to a file, so I think it will be hard to read this in any other language...

_________________
Roel

i watch: simpsons, south park, lost, top gear, true blood & fringe
download - documentation - bugs/feature requests - sourceforge -


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 29, 2009 12:13 pm 
Offline

Joined: Sat Jan 31, 2009 6:51 am
Posts: 8
I was researching that a bit, and I also dug into the source code. No dice :(
Unless you guys were to change the format of the file, TED's ability to interoperate with other programs is fairly hindered :(
Either this or a web UI should be on the to-do list. If I get bored and write a patch to make this file XML, will you guys look at it?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 29, 2009 2:07 pm 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 4:11 pm
Posts: 645
Location: Netherlands
sure :)A web service is on the to-do list, altough I have to admit it has a rather low priority at the moment (we first want to finish off the new version). Our idea was to offer some kind of API where other apps can connect to (instead of offering access to the whole configuration). Do you have an idea how that can be done?

_________________
Roel

i watch: simpsons, south park, lost, top gear, true blood & fringe
download - documentation - bugs/feature requests - sourceforge -


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 04, 2009 8:01 pm 
Offline

Joined: Sat Jan 31, 2009 6:51 am
Posts: 8
sorry for my slow response, have been taking a break from programming lately.

Lets say hypothetically that all of TED's settings are stored in an XML file. XML is one of the most standard things out there, so it'd be relatively easy to make other programs read / write those settings, and in turn connect TED to whatever other programs people would want. The two I can think of off the top of my head are a PHP-based web page to let you change TED's settings from a web browser, and a little C# program to sync the TV shows's TED is getting with Google Calendar, so that I can see that tomorrow I have 3 new shows airing.

The two problems I can see in this are:
1-TED needs to know when to re-parse the settings file. This could be as dumb as periodically polling the file's timestamp to see if its been changed, or having a time/date stamp in the XML itself.

2-You need to have a backup plan in case some external program mangles the XML. One way to handle this would be to rename the malformed file and then dump the current settings from memory to a new settings.xml file, or have TED make its own backup file when the user changes their settings from TED.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 08, 2009 4:48 pm 
Offline
Developer

Joined: Thu Oct 08, 2009 1:18 am
Posts: 62
As far as using the data from TED. It should be relatively simple to add an XStream output version of shows.ted alongside the standard version. Just add the library and change TedIO:SaveShows.

That being said. I'd like to see a more standard version of what the current show configuration is first. A vector of TedSerie objects each with 14 deprecated fields, and it's own scheduler, which may contain it's own TedParser, which contains two non-serializable objects, likely isn't optimal :smile:.

Kenny

PS: While looking at TedIO:SaveShows(). isSavingShows should be checked/changed in a synchronized block (or using a Lock) to prevent a race condition, and would be better cleared (unlocked) in a finally clause. If you'd like a patch for this let me know.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 08, 2009 8:18 pm 
Offline
Lead Developer
User avatar

Joined: Mon Jan 16, 2006 5:46 pm
Posts: 904
Location: Netherlands
KenMacD wrote:
That being said. I'd like to see a more standard version of what the current show configuration is first. A vector of TedSerie objects each with 14 deprecated fields, and it's own scheduler, which may contain it's own TedParser, which contains two non-serializable objects, likely isn't optimal :smile:.

I agree that it's not optimal but how would you do it otherwise to keep thing backwards compatible?

Quote:
PS: While looking at TedIO:SaveShows(). isSavingShows should be checked/changed in a synchronized block (or using a Lock) to prevent a race condition, and would be better cleared (unlocked) in a finally clause. If you'd like a patch for this let me know.

If you could make such a fix that would be great! The more stuff we don't have to program ourselves the better ;)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 09, 2009 4:08 am 
Offline
Developer

Joined: Thu Oct 08, 2009 1:18 am
Posts: 62
Jofo wrote:
KenMacD wrote:
That being said. I'd like to see a more standard version of what the current show configuration is first. A vector of TedSerie objects each with 14 deprecated fields, and it's own scheduler, which may contain it's own TedParser, which contains two non-serializable objects, likely isn't optimal :smile:.

I agree that it's not optimal but how would you do it otherwise to keep thing backwards compatible?


That I don't know. I'd probably keep it in some other format that would be more easily translated between versions. Perhaps xml or protobufs.

I'd also try to limit the saved data to the minimum required to lookup shows again on reload.

Jofo wrote:
KenMacD wrote:
PS: While looking at TedIO:SaveShows(). isSavingShows should be checked/changed in a synchronized block (or using a Lock) to prevent a race condition, and would be better cleared (unlocked) in a finally clause. If you'd like a patch for this let me know.

If you could make such a fix that would be great! The more stuff we don't have to program ourselves the better ;)


I'll email a patch.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group