Solved

Dynamically pull Album Art from Amazon

Posted on 2006-06-27
3
364 Views
Last Modified: 2006-11-18
Hello I would like to dynamically pull in album art from amazon for my personal music server.
I have come to the point where i understand amazon's link structure to the images.   This information can be found here (and many other places): http://aaugh.com/imageabuse.html

The actual URL looks like the following:
http://images.amazon.com/images/P/0762423374.01._PE20_SCMZZZZZZZ_.jpg

I could get this working but here is the cather, I dont want to look up every album to obtain the
ASIN.   In the example above the ASIN is 0762423374.   This is the isbn number (stripped of slashes for books), but there is not a set algorithm for calculating the ASIN for a album.

So...
1) Prove me wrong and find the ASIN algorithm based on Artist/Album
                or
2) Provide an alternative method.

Again i want to do this dynamically (nothing stored).  Here is a website that is doing something
similar to what i want (but i dont want to enter information, just pass variables):
http://art4itunes.com/getart/uploadtracks.php

Thanks and goodluck...


0
Comment
Question by:epiphone32
3 Comments
 
LVL 37

Expert Comment

by:Harisha M G
ID: 16995710
Hi, try this:

<?
    $str = file_get_contents("http://aaugh.com/imageabuse.html");

    preg_match_all("#\b\d{10}\b#",$str,$matches);
    $ASIN = array_unique($matches[0]);
    print_r($ASIN);
?>


---
Harish
0
 
LVL 7

Accepted Solution

by:
CraigHarris earned 500 total points
ID: 16996128
Amazon provide access to almost all over their stuff via web services: http://www.amazon.com/gp/browse.html/103-6589174-6084642?node=3435361
0
 
LVL 18

Expert Comment

by:ingwa
ID: 17018773
There is no specific alogithm for how Amazon creates ASINs.  ASINs are uniquely identifiable codes that are used to identify every single product on their website.  Origionally, as they were solely book sellers, their ASINs were actually the ISBN numbers from the books as you have already identified.  You will find that the ASINs for every book listed are identical to the ISBNs without the dashes (-).  

As albumns don't have ISBN numbers, Amazon has to: either manually, or through some automated incriment number in a database, assign an ASIN to an item.  If it's a book they use the isbn, if it's any thing else then it's a random/auto_incrimental number.

Further more, to be able to retrieve information from Amazon's site, I would go with what craig suggested and signup for their web services.  

Hope this helps.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now