Link to Netflix instead of Amazon?

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
rvaessen
Contributor
Contributor
Posts: 7
Joined: Tue Nov 02, 2004 11:00 am
Location: Aurora, CO
Contact:

Link to Netflix instead of Amazon?

Post by rvaessen »

Has anyone figured out a way to modify a DVDPedia template so that the cover image links to a Netflix lookup instead of the Amazon store? I'd like to make it easier for viewers (of my movie reviews/movie collection) to add a movie to their Netflix queue.
User avatar
Nora
Site Admin
Posts: 2155
Joined: Sun Jul 04, 2004 5:03 am
Contact:

Re: Link to Netflix instead of Amazon?

Post by Nora »

You have to change the link in the template to Netflix which isn't hard but unfortunately the way the links are created it's going to be a bit tricky to include.

Links in Netflix have this format:

Code: Select all

http://www.netflix.com/Movie/Harry_Potter_and_the_Half-Blood_Prince/70099612
which means in your template the link would have to look like this:

Code: Select all

http://www.netflix.com/Movie/[key:title]/[key:custom1]
That number at the end is an internal Netflix ID which you'd have to add manually to your DVDpedia database so the program can pick it up during export, for example from a custom field as used above.

Trickier though is the title part of the link since the spaces need to be replaced with underscores. You could use a javascript function that'll do the replace for you. (This is cobbled together; if anyone has a more elegant solution, please post!)

In the head you'd have this function:

Code: Select all

<script type="text/javascript">

function replaceSpace(aLink) {
   aLink.replace(" ", "_");
   document.open(aLink);
}
</script>
And the link in the body would look like this:

Code: Select all

<a href="javascript:replaceSpace(http://www.netflix.com/Movie/[key:title]/[key:custom1])"></a>
Post Reply