Author |
Message |
Registered: January 4, 2009 | Posts: 4 |
| Posted: | | | | First off; great program, great community. Quick thanks to Gadgeteer, whose Widescreen plus layout I am using, and RHO & Goodguy whose plug-ins are some of the most useful pieces of coding I have ever had the pleasure of using. Also anyone to else who has contributed, thanks.
Down to business. Is there a HTML window that directs itself to the DVD on Amazon? Like the IMDb and Wikipedia windows in Gadgeteers layout? I am entering a rather large DVD collection and find myself referencing Amazon for DVD features quite a bit. Not having to switch out of Profiler would save quite a bit of time.
If not, would it be possible to recode the Wikipedia page to do it? I'm not a code monkey but I have coded a little before. I did a google search for pulling info off of Amazon and all I got was Amazon deals! Could some kind soul direct me to information I would need to do this?
Thanks |
|
Registered: May 26, 2007 | Reputation: | Posts: 599 |
| Posted: | | | | I got this from someone's layout, can't remember whose. Just paste this into a new HTML section you create. Quote: <HTML> <HEAD> <SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
function amazon() { var UPC = DP_UPC; var matchErg = DP_Notes.match(/asin:\s*(.+)$/i); if (matchErg) { var amazonlink = "http://www.amazon.com/dp/" + matchErg[1]; } else { var amazonlink = "http://www.amazon.com/s?url=search-alias%3Ddvd&field-keywords=" + UPC; } window.location.href= amazonlink; }
//--> </SCRIPT> </HEAD> <BODY onload="amazon();"> </BODY> </HTML> |
|
Registered: January 4, 2009 | Posts: 4 |
| Posted: | | | | Thank you so much. |
|
Registered: March 13, 2007 | Posts: 21 |
| Posted: | | | | Gave this a try (altering amazon.com to amazon.co.uk) and it is not fully working as it adds extra characters to the end of the UPC ".4" for the region 2 for example
e.g. 5035822908031.4
If I remove that and search again in the window the dvd is found.
Any idea how I can stop the extra info which is (I think) to do with the region .4 ?
RAP | | | Last edited: by RAPepper |
|
Registered: March 18, 2007 | Reputation: | Posts: 6,463 |
| Posted: | | | | Quoting RAPepper: Quote: Gave this a try (altering amazon.com to amazon.co.uk) and it is not fully working as it adds extra characters to the end of the UPC ".4" for the region 2 for example
e.g. 5035822908031.4
If I remove that and search again in the window the dvd is found.
Any idea how I can stop the extra info which is (I think) to do with the region .4 ?
RAP Add this, just after "var UPC ...." var ix = UPC.indexOf("."); if (ix > 0) UPC = UPC.substring(0, ix); I didn't test it, but it should be close. | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. |
|
Registered: May 26, 2007 | Reputation: | Posts: 599 |
| Posted: | | | | Quoting mediadogg: Quote: Quoting RAPepper:
Quote: Gave this a try (altering amazon.com to amazon.co.uk) and it is not fully working as it adds extra characters to the end of the UPC ".4" for the region 2 for example
e.g. 5035822908031.4
If I remove that and search again in the window the dvd is found.
Any idea how I can stop the extra info which is (I think) to do with the region .4 ?
RAP
Add this, just after "var UPC ...."
var ix = UPC.indexOf("."); if (ix > 0) UPC = UPC.substring(0, ix);
I didn't test it, but it should be close. It works. | | | Last edited: by Antares |
|
Registered: March 13, 2007 | Posts: 21 |
| Posted: | | | | Works for me to - thanks
RAP |
|
| Muckl | That's my common name. |
Registered: April 9, 2009 | Reputation: | Posts: 858 |
| Posted: | | | | Thanks, very nice. For anyone who's interested, here's my modified version that fits into the layout columns. If you change the TLD back to .com, you have to delete/comment the two lines after "var UPC = DP_UPC;". Quote:
<HTML> <HEAD> <SCRIPT TYPE="text/javascript"> <!-- <DP NAME="HEADER_VARS" Language="JavaScript" Comments="True" IncludeCast="False" IncludeCrew="False">
function $(id) { return document.getElementById(id); }
function getHttpRequest(url) { var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open("GET", url, true); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState != 4) { $('result').innerHTML = '<p style="padding: 10px;">Loading ...</p>'; } if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { $('temp').innerHTML = xmlhttp.responseText; $('result').innerHTML = $('result_0').innerHTML; $('temp').innerHTML = ""; $('result').id = "result_0"; } } xmlhttp.send(null); }
function amazon() { var UPC = DP_UPC; var ix = UPC.indexOf("."); if (ix > 0) UPC = UPC.substring(0, ix); getHttpRequest("http://www.amazon.de/s?url=search-alias%3Ddvd&field-keywords=" + UPC); }
//--> </SCRIPT> <STYLE TYPE='text/css'> @import url("http://z-ecx.images-amazon.com/images/G/01/nav2/gamma/search-css/search-css-search-18639._V245173371_.css"); body { margin: 0px; font-size: 12px; } div#temp, div.number, div.fastTrack, div.sss, div.prime { display: none !important; } </STYLE> <BASE TARGET="_blank"> </HEAD> <BODY onload="amazon();"> <DIV id="temp"></DIV> <DIV id="searchTemplate"> <DIV id="atfResults"> <DIV class="listView"> <DIV id="result" class="result firstResultRow lastResultRow"></DIV> </DIV> </DIV> </DIV> </BODY> </HTML>
| | | 1.0.1, iPhone 3GS, iOS 4.1.0
Trivia v0.3.1 My HSDB v5 additions, HTML windows and other stuff | | | Last edited: by Muckl |
|
Registered: May 27, 2007 | Posts: 691 |
| Posted: | | | | Only get an empty window. | | | Unfortunately, I can't use DVDprofiler at the moment due to lack of a Windows computer. |
|
Registered: March 18, 2007 | Reputation: | Posts: 6,463 |
| Posted: | | | | Quoting Muckl: Quote: Thanks, very nice.
For anyone who's interested, here's my modified version that fits into the layout columns. If you change the TLD back to .com, you have to delete/comment the two lines after "var UPC = DP_UPC;".
Are you sure? It is looking for a "." in the UPC and does nothing if not there. So, no change should be necessary. | | | Thanks for your support. Free Plugins available here. Advanced plugins available here. Hey, new product!!! BDPFrog. |
|