I have a website (www.7bks.com) where people create lists of books. This is pretty simple at the moment. I already use the Amazon API to display book information, images, etc. To the website.
What I would like to do is use the Amazon API to display categories and / or tag data in order to create some way to view the listings on my site. Unfortunately, the tag api method has been terminated.
The most likely candidate is the Amazon BrowseNodes API method (http://docs.amazonwebservices.com/AWSEcommerceService/2005-10-05/ApiReference/BrowseNodesResponseGroup.html), but the data returned from this call is pretty pointless and I hoped that we we can unite our heads and find out how to understand this.
Here's a google spreadsheet to show you the data that I get. I selected a sample list (http://www.7bks.com/list/549002) and completed three books through the BrowseNodes API:
https://spreadsheets.google.com/ccc?key=0ApVjkgehRamudHd5SlNhYllPQkZDSDY1cllfQVBQM1E&hl=en&authkey=CN_MxoAO
Looking at the list as a person, you do not need to know what books are to see that it is probably a list about Sci-Fi and Fantasy. This is mainly because the eye is good at dropping meaningless categories such as "custom stores" and "fiction complete."
I tried to reset the list of categories or just looked at the categories that appear for all 3 books, but still pretty shitty data. I would like your thoughts on how I can turn this data into something meaningful for users.
, , . - :
( " " ) > 3,
( "- " ) > 3, -
.
, /.
.
, , API, Python/Appengine/Webapp.
Tom
. , python, , . , - .
, , :
1) XML node node, ( > ), , . . : http://www.amazon.co.uk/Surface-Detail-Iain-M-Banks/dp/1841498939/ " ". .
2) , , ( > ). ,
3) , , , .
, , :
def getcategories(xml):
categories = []
for book in xml.getElementsByTagName('BrowseNode'):
category = get_text(book,'Name')
categories.append(category)
taglists = []
while 'Books' in categories:
find = categories.index('Books') + 1
list = categories[:find]
taglists.append(list)
for word in list:
categories.remove(word)
final = []
for tagset in taglists:
while 'Subjects' in tagset:
final.append(tagset[0])
tagset.pop(tagset.index('Subjects'))
return final
class Browsenodes(webapp.RequestHandler):
def get(self):
asin = self.request.get('term')
if book_title:
api = API(AWS_KEY, SECRET_KEY, 'uk', processor=minidom_response_parser)
try:
result = api.similarity_lookup(asin, ResponseGroup='BrowseNodes')
except:
result = api.item_lookup(asin, ResponseGroup='BrowseNodes')
final = getcategories(result)
self.response.out.write(set(final))
:
:
http://www.amazon.co.uk/Surface-Detail-Iain-M-Banks/dp/1841498939/
:
http://www.amazon.co.uk/Godel-Escher-Bach-Eternal-anniversary/dp/0140289208/
AAS
,
: 1900-
http://www.amazon.co.uk/Flatland-Romance-Dimensions-Dover-Thrift/dp/048627263X/
AAS
,
: 1900-
http://www.amazon.co.uk/Victoria-Condor-Books-Knut-Hamsun/dp/0285647598/
AAS