Getting the new series info

A place for developers to advertise their TheTVDB.com enabled app and get help from other developers with the API.
Post Reply
firefly
Posts: 6
Joined: Sun Nov 06, 2011 9:28 am

Sun Nov 06, 2011 9:56 am

I'm thinking of building a tv shows db to accompany my TV blog (foreign, non-commercial), and since I don't have a detailed database, I have downloaded your db dump from September.

Does Updates.php API get info about newly added tv shows (created after db dump)? In other words, will I be able to automatically get new shows via API, or will I have to add tem manually to my db first?

Ninja edit:
Oh yeah, I should say I'm impressed with database size and scope. It will make my job way more easy than I first anticipated.
I'll look into an option of us doing show descritpion translations for at least major US and UK tv shows.
firefly
Posts: 6
Joined: Sun Nov 06, 2011 9:28 am

Sun Nov 06, 2011 10:13 am

Forgot - and edit time has passed:

Aren't "tvseries" and "networks" tables connected? "NetworkID" column is mostly NULL and the "tvseries" table also has "Network" column.
etw
Site Moderator
Posts: 1138
Joined: Sat Oct 16, 2010 3:48 pm
Location: England

Sun Nov 06, 2011 11:24 am

Can't help you with any API queries myself, but your post made me wonder about a few things:
firefly wrote:I'm thinking of building a tv shows db to accompany my TV blog (foreign, non-commercial), and since I don't have a detailed database, I have downloaded your db dump from September.
I may be missing something here but it sounds like you are trying to build an alternative to thetvdb.com just to show data that is already (or will be added later) on the site. Why not just link to the relevant pages/query stuff from the api as required?
firefly wrote:I'll look into an option of us doing show description translations for at least major US and UK tv shows.
Wasn't sure if you meant doing them on your site or adding them to thetvdb.com. If you meant thetvdb.com then :) if not then I assume you do know this site does support translations already, eg: http://www.thetvdb.com/index.php?string ... &alllang=1

As for using the api, have you looked at the wiki in particular: http://www.thetvdb.com/wiki/index.php/API:Updates
(also some unofficial documentation: http://forums.thetvdb.com/viewtopic.php?f=17&t=8012)
firefly
Posts: 6
Joined: Sun Nov 06, 2011 9:28 am

Sun Nov 06, 2011 12:25 pm

etw wrote:I may be missing something here but it sounds like you are trying to build an alternative to thetvdb.com just to show data that is already (or will be added later) on the site. Why not just link to the relevant pages/query stuff from the api as required?
It's a foreign site, so it wouldn't be an alternative per se, and it would be complementary service to my already existing tv site / blog (articles, reviews etc). For example, I'd like to display some sort of an "info box" every time an article is tagged with a particular show. I'd have to link tag ID-s (wordpress) with shows in my local database, so there is that...
And I can't do a query for a show name every time an article mentions it, as I cannot write a script that would always get only one relevant show (i.e - if I have an article tagged with a show "Boss", if I do a API query, I'll get more than a few shows that have "boss" in their name).

So I'd like to build a local database with relevant information, add wordpress tag ID's to the table for shows we have written about, and display data when needed.
To get back to an original question - I'd be nice if I could populate database with new shows automatically when they are added here.

I might be missing something, tho. I haven't thoroughly researched thetvdb API, TBH. Just bouncing ideas in my head. If I'm stepping out of allowed database usage, please tell me.

And yeah, I know it supports translation, I meant that - "look into" as in "research what is neccessary to start translating" :)
firefly
Posts: 6
Joined: Sun Nov 06, 2011 9:28 am

Sun Nov 06, 2011 12:33 pm

Also, to add re: building thetvdb alternative... I would strip the original database as much as I can to remove data I don't need - like foreign shows, episode listings and descriptions etc.
Coco
Site Admin
Posts: 2472
Joined: Tue Mar 13, 2007 8:16 pm
Location: Canada

Sun Nov 06, 2011 1:26 pm

The update part of the API just gives recent updates to the DB, it never relates to a DB dump. The DB dump isn't supported in anyway on this site and we don't even recommend anyone use it (You can if you want, you're just on your own). The site is designed to give information on episodes people have, the API is not design for people to keep complete lists of all shows.

You can still use the DB dump as you see fit and the API could maybe be used to help you with what you're trying to achieve. As long as you don't rape our bandwidth you can use it but you're really trying to do things we don't support.

The networks table does not relate to the tvseries table, this is simply because the networks table was originally only a text field in the tvseries table. We broke it out and started standardizing the text with the intent of switching it to use the network ID but stopped. The same kind of issue occur with the actors table and a few others.

The current DB has many issues and limitations. At this point we've actually stopped changing it and have rewritten the entire DB. So we'll fix everything in one swoop when we release the new site. It's also worth noting that the seriesname field in the tvseries table isn't used. The site wasn't originally Multilanguage so that field was used, now a days that field is still populated (I think) but isn't actually in use as all series names are stored in the translation tables.
Please don't PM me. Post in the forums instead unless there is a very good reason for a PM or I won't respond.
firefly
Posts: 6
Joined: Sun Nov 06, 2011 9:28 am

Sun Nov 06, 2011 1:48 pm

Coco wrote:The update part of the API just gives recent updates to the DB, it never relates to a DB dump.
So help me clear out one thing - updates.php returns list of shows and episodes updated since <timestamp value it receives>. For example:

<Series>80348</Series>
<Series>73104</Series>
<Series>74845</Series>
<Episode>7653651</Episode>

If there is a new show added here, on thetvdb.com, would it's seriesid be listed there (at updates.php API)?

Re: bandwidth usage, I plan to use the db dump for those exact reasons, to keep data locally and not to overuse the API, and just update local database when needed. I plan to create a script that would run once a day at most (or week), check for changes, fetch data for shows that have had data altered (listed in updates.php) with - <mirrorpath_zip>/api/<apikey>/series/<seriesid>/all/<language>.zip
Then process the data on my end, and extract data I need.
firefly
Posts: 6
Joined: Sun Nov 06, 2011 9:28 am

Sun Nov 06, 2011 2:45 pm

A followup question... Is this not working, or am I not using it correctly?

http://www.thetvdb.com/wiki/index.php/API:Static_Update
"By calling /api/<apikey>/updates/yyyy-mm-dd.xml you can retrieve all of the updates for any day"

I've tried with http://thetvdb.com/api/<my-api-key>/upd ... -10-11.xml, but I'm only getting 404.
Coco
Site Admin
Posts: 2472
Joined: Tue Mar 13, 2007 8:16 pm
Location: Canada

Mon Nov 07, 2011 11:35 am

Check the wiki, I've updated it. The method you're trying to use is deprecated.

http://www.thetvdb.com/wiki/index.php/A ... te_Records
Please don't PM me. Post in the forums instead unless there is a very good reason for a PM or I won't respond.
Post Reply