Website bug

Peter Corlett abuse at cabal.org.uk
Sat Jan 5 21:48:47 GMT 2008


On 5 Jan 2008, at 18:30, Simon Wistow wrote:
> On Fri, Jan 04, 2008 at 02:55:52PM +0000, Dave Cantrell said:
>> There's a bug in the magic that converts XML into HTML for the  
>> website -
>> if a book has an ISBN-13 (and all new books should now) then the  
>> Amazon
>> URL used to linked them is broken cos ASINs are still only 10 digits.
> Is there a mapping from ISBN-13 to ASIN? If not I'll hack the logic to
> just not link.

This page:

https://affiliate-program.amazon.co.uk/gp/associates/help/t23/a1?ie=UTF8&pf_rd_t=501&pf_rd_m=A3P5ROKL5A1OLE&pf_rd_p=&pf_rd_s=assoc-left-1&pf_rd_r=&pf_rd_i=assoc_help_main

suggests that you're supposed to do an Amazon API call to get an ASIN  
from an ISBN-13, which is a bit suboptimal. However, an easy and  
obvious thing to do is to convert ISBN-13s starting 978 to ISBN-10s  
and then use that as the ASIN.

The conversion just involves lopping the 978 off the front and  
recalculating the checksum. ISTR spotting a module on CPAN to do this  
although it's not all that tricky to roll your own.




More information about the london.pm mailing list