Solved

Dynamically pull Album Art from Amazon

Posted on 2006-06-27
3
363 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

707 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

21 Experts available now in Live!

Get 1:1 Help Now