Registered: May 26, 2007 | Reputation: | Posts: 599 |
| Posted: | | | | Excuse my ignorance, but I've been trying to make a HTML section for Find-DVD.co.uk using a title search and I'm having a small problem. First, I honestly don't know what I'm doing, but I've basically been cutting & pasting from the Wiki HTML section I have in my layout and editing in what I think are the correct links. I'm trying to do at least a title search on the site, but would also like to do a UPC search if possible. I have the HTML working up to this point... What do I need to change in the code to get it to submit the title? And if you're feeling extra helpful, also search using UPC? Here's the code so far... Quote: <HTML> <HEAD> <SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
function FindDVD() { var title = DP_Title; var matchErg = DP_Notes.match(/FindDVD:\s*(.+)$/i); if (matchErg) { var FindDVDilink = "http://www.find-dvd.co.uk/" + matchErg[1]; } else { var FindDVDlink = "http://www.find-dvd.co.uk/search.aspx?title="; } window.location.href= FindDVDlink; }
//--> </SCRIPT> </HEAD> <BODY onload="FindDVD();"> </BODY> </HTML> Any help would be greatly appreciated. | | | Last edited: by Antares |
|
Registered: March 13, 2007 | Posts: 350 |
| Posted: | | | | Quoting Antares: Quote: What do I need to change in the code to get it to submit the title? I think you need to change Quote: var FindDVDlink = "http://www.find-dvd.co.uk/search.aspx?title="; to Quote: var FindDVDlink = "http://www.find-dvd.co.uk/search.aspx?title="+title; Quote: And if you're feeling extra helpful, also search using UPC? FindDVD does not appear to have a search by EAN/UPC. It isn't obvious from the 15 seconds that i looked at the site if they use that very much ... | | | -fred |
|
Registered: May 26, 2007 | Reputation: | Posts: 599 |
| Posted: | | | | Thanks you very much, it worked. Green arrow for you! |
|
Registered: May 26, 2007 | Reputation: | Posts: 599 |
| Posted: | | | | Quoting FredLooks: Quote: FindDVD does not appear to have a search by EAN/UPC. Would it be possible to search using Director instead? | | | Last edited: by Antares |
|
Registered: March 13, 2007 | Reputation: | Posts: 2,005 |
| Posted: | | | | Quoting Antares: Quote: Quoting FredLooks:
Quote: FindDVD does not appear to have a search by EAN/UPC.
Would it be possible to search using Director instead? This should work: var FindDVDlink = "http://www.find-dvd.co.uk/director.aspx?director=<DP NAME="CREW_DIRECTION">"; | | |
|
|
Registered: March 14, 2007 | Reputation: | Posts: 1,029 |
| Posted: | | | | Quoting TomGaines: Quote: Quoting Antares:
Quote: Would it be possible to search using Director instead? This should work: var FindDVDlink = "http://www.find-dvd.co.uk/director.aspx?director=<DP NAME="CREW_DIRECTION">"; Sorry, it won't, because the DP tag will include HTML tags. You either have to put the DP tag in a hidden DIV tag and extract the first line of the innerText property or you have to include Crew in the HEADER_VARS, search for the first Director entry in DP_CrewEntries, and normalize that name. Also you should always call escape() for parameters appended to a query URL. Lastly, the director search on www.find-dvd.co.uk is pretty poor. It seems to require exact spelling of the full director name. For example, it will find neither "Spielberg", nor "Steven++Spielberg" (2 spaces), only the exact spelling of "Steven+Spielberg". | | | Matthias |
|