vasujain wrote:
I am still not able to get anything fruitful from the API wiki. May be i am a naive developer .
Anyways, i could not find the database for Series. Do i need to create a replcia of db on my local machine and then use api calls ?
No, all the calls are documented under "File Structure" & "Example Usage" on
http://www.thetvdb.com/wiki/index.php/Programmers_API. If you do want a snapshot of the entire database you are able to get one from a topic on the forums somewhere but these are rarely needed by developers and you still need to use the api to keep upto date.
vasujain wrote:
What i need to do is:
1. Provide a user interface for entering a show.
2. For that selected show i form a URL using the code
var mirror="http://thetvdb.com/";
var showURL= mirror + "api/GetSeries.php?seriesname=" + show + "&language=" + lang;
3. Now i am generating an XML file here which i can see on browser but when i try to get this xml file into a string, my code fails.
As has been pointed out above this is due to cross domain restrictions in browsers. This stops javacript from somedomain1.com calling a file from somedomain2.com. To get around this you will probably need to implement a server side proxy on your site (using php/asp/perl/python etc). This will mean your data flow goes: javascript on webpage -> your local proxy -> thetvdb.com api and back again. If you google "javascript cross domain" you'll get a load of pages explaining the browser limitations and possible solutions. We can help with API related issues but we won't be able to help you implement an intermediate proxy to be able to access the api from javascript
vasujain wrote:
also i am doubtful this might be happening because there is no place where i was required to use my API Key,
Please suggest ...
As documented on the wiki page, not all the calls require api keys, for example step 3 doesn't but step 4 does:
Quote:
Step 3: Loop through and look up each series id
a. Retrieve
http://www.thetvdb.com/api/GetSeries.php?seriesname=<series name from your database>
b. Optionally present results to user so they can select the match they want.
c. Store this series id in a table in your database.
Quote:
Step 4: Get base information for each series
a. Retrieve <mirrorpath_zip>/api/<apikey>/series/<seriesid>/all/<language>.zip and extract <language>.xml and banners.xml.
b. Process the XML data in <language>.xml and store all <Series> data.
c. Download each series banner in banners.xml and prompt the user to see which they want to keep.
Note: Make sure you record <id> from each series, since it's returned in updates as <Series>.
_________________
---
Please watch this video to help
LSU Computer Society try to win the
RBS ESSA society competition!
http://youtu.be/8JrhmoSXLXw - only 1:36min
Thanks
