AWS/PHP/mySQL - clueless newbie needs help!

Status
Not open for further replies.

booksgo

New Member
Messages
109
Reaction score
0
Points
0
I sell books on amazon.co.uk and what I'd like to do is have all my items on Amazon linked from my not-yet-built website hosted on x10.

So I was thinking that for a start I'd use AWS to retrieve my listings using this:

http://webservices.amazon.co.uk/onc...tingPage=1&Sort=-startdate&Version=2008-04-07

which returns xml like this, with 10 results:

<?xml version="1.0" encoding="UTF-8" ?>
- <SellerListingSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2008-04-07">
- <OperationRequest>
- <HTTPHeaders>
<Header Name="UserAgent" Value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
</HTTPHeaders>
<RequestId>1VCVXASJXJY91WEP0HCR</RequestId>
- <Arguments>
<Argument Name="Sort" Value="-startdate" />
<Argument Name="ListingPage" Value="1" />
<Argument Name="Service" Value="AWSECommerceService" />
<Argument Name="AWSAccessKeyId" Value="(my.access.key)" />
<Argument Name="SellerId" Value="A2PRXGY7GRFPGX" />
<Argument Name="Version" Value="2008-04-07" />
<Argument Name="ResponseGroup" Value="SellerListing" />
<Argument Name="Operation" Value="SellerListingSearch" />
</Arguments>
<RequestProcessingTime>0.206453084945679</RequestProcessingTime>
</OperationRequest>
- <SellerListings>
- <Request>
<IsValid>True</IsValid>
- <SellerListingSearchRequest>
<ListingPage>1</ListingPage>
<ResponseGroup>SellerListing</ResponseGroup>
<SellerId>A2PRXGY7GRFPGX</SellerId>
<Sort>-startdate</Sort>
</SellerListingSearchRequest>
</Request>
<TotalResults>5845</TotalResults>
<TotalPages>585</TotalPages>
- <SellerListing>
<ExchangeId>Y09Y4610358Y3144538</ExchangeId>
<ListingId>0513H546942</ListingId>
<ASIN>B000S5O6WU</ASIN>
<SKU>/hj5357/</SKU>
<WillShipExpedited>0</WillShipExpedited>
<WillShipInternational>1</WillShipInternational>
<Title>Queen Of The Daffodils - A Story of High-School Life [Hardcover] by Leslie...</Title>
- <Price>
<Amount>895</Amount>
<CurrencyCode>GBP</CurrencyCode>
<FormattedPrice>£8.95</FormattedPrice>
</Price>
<StartDate>2008-05-13</StartDate>
<EndDate>2011-04-28</EndDate>
<Status>Open</Status>
<Quantity>1</Quantity>
<Condition>used</Condition>
<SubCondition>acceptable</SubCondition>
- <Seller>
<SellerId>A2PRXGY7GRFPGX</SellerId>
<Nickname>booksgo</Nickname>
</Seller>
</SellerListing>
- <SellerListing>
<ExchangeId>Y09Y0130258Y5553515</ExchangeId>
<ListingId>0513F607845</ListingId>
<ASIN>B000IYXKPA</ASIN>
<SKU>/hn5358/</SKU>
<WillShipExpedited>0</WillShipExpedited>
<WillShipInternational>0</WillShipInternational>
<Title>The Drifting Island [Hardcover] by Wentworth, Walter</Title>
- <Price>
<Amount>595</Amount>
<CurrencyCode>GBP</CurrencyCode>
<FormattedPrice>£5.95</FormattedPrice>
</Price>
<StartDate>2008-05-13</StartDate>
<EndDate>2011-04-28</EndDate>
<Status>Open</Status>
<Quantity>1</Quantity>
<Condition>used</Condition>
<SubCondition>acceptable</SubCondition>
- <Seller>
<SellerId>A2PRXGY7GRFPGX</SellerId>
<Nickname>booksgo</Nickname>
</Seller>
</SellerListing>
- <SellerListing>
<ExchangeId>Y09Y0332249Y0389734</ExchangeId>
<ListingId>0513T157891</ListingId>
<ASIN>B0014MFVXY</ASIN>
<SKU>/hn5357/</SKU>
<WillShipExpedited>0</WillShipExpedited>
<WillShipInternational>1</WillShipInternational>
<Title>The Sunset Express. A story of Canadian railway life, etc [Unknown Binding] by</Title>
- <Price>
<Amount>1495</Amount>
<CurrencyCode>GBP</CurrencyCode>
<FormattedPrice>£14.95</FormattedPrice>
</Price>
<StartDate>2008-05-13</StartDate>
<EndDate>2011-04-28</EndDate>
<Status>Open</Status>
<Quantity>1</Quantity>
<Condition>used</Condition>
<SubCondition>acceptable</SubCondition>
- <Seller>
<SellerId>A2PRXGY7GRFPGX</SellerId>
<Nickname>booksgo</Nickname>
</Seller>
</SellerListing>
I'VE SNIPPED THE OTHERS
</SellerListings>
</SellerListingSearchResponse>


So then I want to take the ASIN value for each item and have it automatically inserted it into this url, where it says ASIN:

http://www.amazon.co.uk/gp/offer-li...?ie=UTF8&seller=A2PRXGY7GRFPGX&tag=booksgo-21

So the end result would be a html page with a list of titles each with a link to its own page on Amazon where I have my description

eg.
1) Queen Of The Daffodils - A Story of High-School Life [Hardcover] by Leslie... l
inked to:http://www.amazon.co.uk/gp/offer-li...?ie=UTF8&seller=A2PRXGY7GRFPGX&tag=booksgo-21

2) The Drifting Island [Hardcover] by Wentworth, Walter
linked to:http://www.amazon.co.uk/gp/offer-li...?ie=UTF8&seller=A2PRXGY7GRFPGX&tag=booksgo-21

3) etc.

Hopefully I've made it clear.

If that is possible, the next hurdle is that Amazon AWS only returns 10 results per page, up to a max. of 500 pages (by changing the &ListingPage= value) ie a max. of 5000 items. As I currently have 5,800+ items that isn't enough, but I think the way round it is to reverse the startdate order which is easy enough, so to get the 5000 oldest items as well as the 5000 newest items which gives me a bit of leeway until I get around to listing 4000 more items, which won't be happening for a while, if ever.

Anyway, I guess it would need a database and PHP - both of which I don't know anything about!

All ideas appreciated, especially if they are expressed in simple language :)
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
Personally, I would recommend using xslt since it's easier and more efficient than using php in this case. If you know xml/xpath, then you should take a look at it here:

http://www.w3schools.com/xsl/default.asp

To accomplish what you have in mind, you'd really only have to know how to use the for-each and value-of elements along with a few basic elements required in all xslt documents.

However if you'd rather use php, the code wouldn't be too difficult. There would be no db involvement either if I'm correct in assuming that the asin and title can be obtained from amazon. I can make the code rather quickly, but I need to know what's returned when a page is requested which is beyond 500 or the max amount your current items would allow for. For example, if you entered 10000 for the ListingPage. It doesn't look like a 404 would be given judging by what happens when I click that link with no access key.

Additionally, the html format you would like the links to be in as well as the exact change to the url required to "reverse the startdate"(is it just removing the minus?) would be useful as well.
 

booksgo

New Member
Messages
109
Reaction score
0
Points
0
Woiwky, thanks for your reply. I've been trying to understand XSLT for a while and have failed. I can't even seem to be able to copy other peoples examples and get them to work! And (to leafpiggy as well) w3schools.com is something I have looked at before but it all seems to be beyond me. A few simple html tags and basic CSS is about all I can understand.

I don't particularly want to use PHP - I don't really mind what I use if it works, so if you are able to help in any way that would be great.

To answer your questions:

a request for a page over 500 returns this in the xml, see <Error><Code><Message>:

- <SellerListings>
- <Request>
<IsValid>False</IsValid>
- <SellerListingSearchRequest>
<ListingPage>1501</ListingPage>
<ResponseGroup>SellerListing</ResponseGroup>
<SellerId>A2PRXGY7GRFPGX</SellerId>
<Sort>-startdate</Sort>
</SellerListingSearchRequest>
- <Errors>
- <Error>
<Code>AWS.ParameterOutOfRange</Code>
<Message>The value you specified for ListingPage is invalid. Valid values must be between 1 and 500.</Message>
</Error>
</Errors>
</Request>
</SellerListings>
</SellerListingSearchResponse>

You are correct that the startdate order is changed by just removing the minus sign.

I suppose the html format for the links would be easiest as a normal <a href="url" target=”blank”>Book Title</a>, assuming that's what you mean by 'format'.

Thanks for your help. I clicked on the blue button in your post, as Ive seen other people asking for that.
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0

booksgo

New Member
Messages
109
Reaction score
0
Points
0
OK, I've achieved it using Yahoo Pipes. It works well but has given me bigger ideas...

Hey Mods - how do I 'close' this thread? I can't see a box to tick or something anywhere?
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
* Closed by Request *

Staff are still investigating the permissions which users have to close their own threads, there should be a drop down menu which says "thread tools" with an option to close the thread in the menu.

Start a new thread if you have any more issues.
 
Status
Not open for further replies.
Top