<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Sat May 25, 2013 1:53 am by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Sat May 25, 2013 1:53 am</pubDate>
  <lastBuildDate>Sat May 25, 2013 1:53 am</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102836#102836</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=67764'&gt;systemaddict&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Nov 16, 2011 8:02 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Here's my script&amp;#058;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/perl -w&lt;br /&gt;
#&lt;br /&gt;
# isbn_convertor - a tool to derive a pre-2007 10-digit ISBN&lt;br /&gt;
# number from a post-2007 13-digit ISBN number.&lt;br /&gt;
#&lt;br /&gt;
# The first three digits of the ISBN-13 number can be discarded&lt;br /&gt;
# but the last digit is a check digit computed from the&lt;br /&gt;
# rest of the number and this has to be re-calculated . . .&lt;br /&gt;
#&lt;br /&gt;
print &amp;quot;Give us the 13 digits, no spaces or dashes: &amp;quot;;&lt;br /&gt;
$isbn13 = &amp;lt;STDIN&amp;gt;;&lt;br /&gt;
chomp($isbn13);&lt;br /&gt;
#&lt;br /&gt;
# create a 13-element array from the input string:&lt;br /&gt;
#&lt;br /&gt;
@isbn13 = split(//, $isbn13);&lt;br /&gt;
#&lt;br /&gt;
# calculation of the check digit is explained at&lt;br /&gt;
# &lt;a href=&quot;http://en.wikipedia.org/wiki/International_Standard_Book_Number&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://en.wikipedia.org/wiki/International_Standard_Book_Number&lt;/a&gt;&lt;br /&gt;
#&lt;br /&gt;
$multiplier = 10;&lt;br /&gt;
 for ($i = 3; $i &amp;lt;12; $i++){&lt;br /&gt;
        $what = $isbn13[$i];&lt;br /&gt;
        $product = $what * $multiplier;&lt;br /&gt;
        $sum += $product;&lt;br /&gt;
        --$multiplier;&lt;br /&gt;
        }&lt;br /&gt;
$mod = $sum % 11;&lt;br /&gt;
$check = 11 - $mod;&lt;br /&gt;
if ($check =~ 10){&lt;br /&gt;
        $check = 'X';&lt;br /&gt;
        }&lt;br /&gt;
@isbn10 = @isbn13[3..11];&lt;br /&gt;
push(@isbn10, $check);&lt;br /&gt;
$asin = join(&amp;quot;&amp;quot;,@isbn10);&lt;br /&gt;
print &amp;quot;Your ASIN is $asin\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I've tested it with 14 books, I got one anomaly where I mistyped the ISBN for The Suspicions of Mr Whicher and got the ASIN for a different book although other mistypes returned errors from Amazon, I guess the check digit isn't infallible.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102836#102836</comments>
                                        <author>systemaddict</author>
                                        <pubDate>Wed Nov 16, 2011 8:02 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102836#102836</guid>
                                      </item>
                                      <item>
                                        <title>Re: LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102814#102814</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=67764'&gt;systemaddict&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Nov 15, 2011 11:17 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I've been looking at the Wikipedia page on ISBN's which says that 13 digit ISBN numbers are made up of a 3-digit country prefix (more or less), a 9-digit reference number and a check digit; it gives the formula for calculating the check digit so I'll nock up a script to convert a 13-digit ISBN to a 10-digit ISBN in the next couple of days.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102814#102814</comments>
                                        <author>systemaddict</author>
                                        <pubDate>Tue Nov 15, 2011 11:17 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102814#102814</guid>
                                      </item>
                                      <item>
                                        <title>Re: LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102812#102812</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=1154'&gt;davorg&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Nov 15, 2011 8:04 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Yeah, it's not really the ISBN. It's actually the Amazon ASIN. That's the ten-character version of the ISBN for books.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102812#102812</comments>
                                        <author>davorg</author>
                                        <pubDate>Tue Nov 15, 2011 8:04 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102812#102812</guid>
                                      </item>
                                      <item>
                                        <title>Re: LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102811#102811</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=67764'&gt;systemaddict&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Nov 15, 2011 7:35 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Got this working at last, got my Associate Tag (even though my web site only has an 'under construction' page), worked out that the AMAZON_SECRET variable needs to be the string which appears when you click the link next to your Access Key ID at &lt;a href=&quot;https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&amp;amp;action=access-key.&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&amp;amp;action=access-key.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The only issue I've now got is over ISBN numbers:&lt;br /&gt;
&lt;br /&gt;
robert@milo:~/programming/perl$ ./book list&lt;br /&gt;
Reading:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To Read:&lt;br /&gt;
&lt;br /&gt;
 * Learning Perl (Randal L. Schwartz)&lt;br /&gt;
 * Heartstone (Matthew Shardlake 5) (C. J. Sansom)&lt;br /&gt;
&lt;br /&gt;
Read:&lt;br /&gt;
&lt;br /&gt;
Learning Perl went in just like that, using the 10-digit ISBN number from the book itself (entered as a single 10-digit string, no dashes) but the 13-digit ISBN from Heartstone wasn't recognised and I had to get the 10-digit ISBN from Amazon's website in order to get it added.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102811#102811</comments>
                                        <author>systemaddict</author>
                                        <pubDate>Tue Nov 15, 2011 7:35 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102811#102811</guid>
                                      </item>
                                      <item>
                                        <title>Re: LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102724#102724</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=1154'&gt;davorg&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Nov 09, 2011 2:57 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hi,&lt;br /&gt;
&lt;br /&gt;
I saw this error when I returned to the project to start work on the next article in the series last week.&lt;br /&gt;
&lt;br /&gt;
Amazon have changed the way that the API authentication works. Now you need to include the associate tag in your requests. Net::Amazon will do that for you if you add it to your call to 'new'.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;my $az = Net&amp;#58;&amp;#58;Amazon-&amp;gt;new&amp;#40;&lt;br /&gt;
&amp;nbsp; token&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; $ENV&amp;#123;AMAZON_KEY&amp;#125;,&lt;br /&gt;
&amp;nbsp; secret_key&amp;nbsp; &amp;nbsp; =&amp;gt; $ENV&amp;#123;AMAZON_SECRET&amp;#125;,&lt;br /&gt;
&amp;nbsp; associate_tag =&amp;gt; $ENV&amp;#123;AMAZON_ASST_TAG&amp;#125;,&lt;br /&gt;
&amp;nbsp; locale&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; 'uk',&lt;br /&gt;
&amp;#41;;&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
It's unfortunate that the changed it in the middle of this series. The really annoying thing is that the second article in the series has already been submitted with the same out of date information. It'll only be in the third article (which won't be published until next year) that I'll be able to include a correction.&lt;br /&gt;
&lt;br /&gt;
Sorry about that,&lt;br /&gt;
&lt;br /&gt;
Dave...</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102724#102724</comments>
                                        <author>davorg</author>
                                        <pubDate>Wed Nov 09, 2011 2:57 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102724#102724</guid>
                                      </item>
                                      <item>
                                        <title>Re: LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102538#102538</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=67764'&gt;systemaddict&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Nov 01, 2011 12:08 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I've just updated my system and It looks like Net::Amazon has been updated to include the associate tag feature:&lt;br /&gt;
&lt;br /&gt;
robert@milo:~/programming/perl$ ./book add 0330258648&lt;br /&gt;
Mandatory paramter 'associate_tag' not defined at /usr/local/share/perl/5.10.1/Net/Amazon.pm line 67.&lt;br /&gt;
&lt;br /&gt;
Didn't get that error last week.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102538#102538</comments>
                                        <author>systemaddict</author>
                                        <pubDate>Tue Nov 01, 2011 12:08 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102538#102538</guid>
                                      </item>
                                      <item>
                                        <title>Re: LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102472#102472</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=67764'&gt;systemaddict&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Thu Oct 27, 2011 2:16 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I've done some digging around the Amazon Product Advertising API website and have discovered that I was sending the wrong identification. &lt;br /&gt;
&lt;br /&gt;
The AMAZON_KEY variable needs to be your Access Key ID, in my case AKIAJEW2TL6RBGT65SXA, not the filename of your public key but we then hit another snag:&lt;br /&gt;
&lt;br /&gt;
robert@milo:~/programming/perl$ ./book add 0750632445&lt;br /&gt;
Error:Your request is missing required parameters. Required parameters include AssociateTag.&lt;br /&gt;
&lt;br /&gt;
There is no mention of an Associate tag in the article or in the code on the DVD, I suspect that Amazon have changed the rules since the article was written.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102472#102472</comments>
                                        <author>systemaddict</author>
                                        <pubDate>Thu Oct 27, 2011 2:16 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102472#102472</guid>
                                      </item>
                                      <item>
                                        <title>Re: LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102444#102444</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=67764'&gt;systemaddict&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Wed Oct 26, 2011 12:09 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I've had a look at the Net::Amazon documentation at Sourceforge and added some debugging. book seems to be doing what it should:&lt;br /&gt;
&lt;br /&gt;
robert@milo:~/programming/perl$ ./book add 9781847394651&lt;br /&gt;
2011/10/26 11:39:40 request: params = $VAR1 = {&lt;br /&gt;
          'ItemId' =&amp;gt; '9781847394651',&lt;br /&gt;
          'ResponseGroup' =&amp;gt; 'Large',&lt;br /&gt;
          'locale' =&amp;gt; 'uk',&lt;br /&gt;
          'Sort' =&amp;gt; 'salesrank',&lt;br /&gt;
          'ItemPage' =&amp;gt; 1,&lt;br /&gt;
          'Operation' =&amp;gt; 'ItemLookup'&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
2011/10/26 11:39:40 urlstr=http://webservices.amazon.co.uk/onca/xml?AWSAccessKeyId=%2Fhome%2FrobertDesktopDownloadsrsa-APKAJKF7VYMOH27RN43Q.pem&amp;amp;ItemId=9781847394651&amp;amp;ItemPage=1&amp;amp;Operation=ItemLookup&amp;amp;ResponseGroup=Large&amp;amp;Service=AWSECommerceService&amp;amp;Sort=salesrank&amp;amp;Timestamp=2011-10-26T10%3A39%3A40Z&amp;amp;Version=2009-07-01&amp;amp;locale=uk&amp;amp;Signature=230gYjcrrPmY7FC4G3OzWnXRSRaDdD2g4iG2HPiDqNQ%3D&lt;br /&gt;
2011/10/26 11:39:40 Fetching &lt;a href=&quot;http://webservices.amazon.co.uk/onca/xml?AWSAccessKeyId=%2Fhome%2FrobertDesktopDownloadsrsa-APKAJKF7VYMOH27RN43Q.pem&amp;amp;ItemId=9781847394651&amp;amp;ItemPage=1&amp;amp;Operation=ItemLookup&amp;amp;ResponseGroup=Large&amp;amp;Service=AWSECommerceService&amp;amp;Sort=salesrank&amp;amp;Timestamp=2011-10-26T10%3A39%3A40Z&amp;amp;Version=2009-07-01&amp;amp;locale=uk&amp;amp;Signature=230gYjcrrPmY7FC4G3OzWnXRSRaDdD2g4iG2HPiDqNQ%3D&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://webservices.amazon.co.uk/onca/xml?AWSAccessKeyId=%2Fhome%2FrobertDesktopDownloadsrsa-APKAJKF7VYMOH27RN43Q.pem&amp;amp;ItemId=9781847394651&amp;amp;ItemPage=1&amp;amp;Operation=ItemLookup&amp;amp;ResponseGroup=Large&amp;amp;Service=AWSECommerceService&amp;amp;Sort=salesrank&amp;amp;Timestamp=2011-10-26T10%3A39%3A40Z&amp;amp;Version=2009-07-01&amp;amp;locale=uk&amp;amp;Signature=230gYjcrrPmY7FC4G3OzWnXRSRaDdD2g4iG2HPiDqNQ%3D&lt;/a&gt;&lt;br /&gt;
Error: Forbidden&lt;br /&gt;
&lt;br /&gt;
The key is the one I downloaded from Amazon Web Services, is it, prthaps the wrong one?</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102444#102444</comments>
                                        <author>systemaddict</author>
                                        <pubDate>Wed Oct 26, 2011 12:09 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102444#102444</guid>
                                      </item>
                                      <item>
                                        <title>LXF 151 Perl project</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=102417#102417</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=67764'&gt;systemaddict&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue Oct 25, 2011 11:09 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I've followed the steps in the tutorial as far as trying out the book add command but all I get is:&lt;br /&gt;
&lt;br /&gt;
robert@milo:~/programming/perl$ ./book add 0330258648&lt;br /&gt;
Error: Forbidden&lt;br /&gt;
&lt;br /&gt;
I take this to mean that Amazon has refused the request. Has anyone got this to work?</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=102417#102417</comments>
                                        <author>systemaddict</author>
                                        <pubDate>Tue Oct 25, 2011 11:09 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=102417#102417</guid>
                                      </item></channel></rss>