就我个人而言,我有大约300位不同书籍的作者(全名)。我想把这份名单分为“小说作者”和“非小说作者”如果一个作者同时写了这两篇文章,那么多数人将获得投票权。
我查看了Amazon产品搜索API:我可以按作者进行搜索(in Python),但无法找到图书类别(小说与休息):

>>> node = api.item_search('Books', Author='Richard Dawkins')
>>> for book in node.Items.Item:
...     print book.ItemAttributes.Title

我有什么选择?我更喜欢用Python。

最佳答案

好吧,你可以试试别的服务-Google Book Search API。要使用Python,可以查看gdata-python-api。在它的协议中,result feed中有一个节点<dc:subject>-可能that's您需要什么:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
      xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"
      xmlns:gbs="http://schemas.google.com/books/2008"
      xmlns:dc="http://purl.org/dc/terms"
      xmlns:gd="http://schemas.google.com/g/2005">
  <id>http://www.google.com/books/feeds/volumes</id>
  <updated>2008-08-12T23:25:35.000</updated>

<!--  a loot of information here, just removed those nodes to save space.. -->

    <dc:creator>Jane Austen</dc:creator>
    <dc:creator>James Kinsley</dc:creator>
    <dc:creator>Fiona Stafford</dc:creator>
    <dc:date>2004</dc:date>
    <dc:description>
      If a truth universally acknowledged can shrink quite so rapidly into
      the opinion of a somewhat obsessive comic character, the reader may reasonably feel ...
    </dc:description>
    <dc:format>382</dc:format>
    <dc:identifier>8cp-Z_G42g4C</dc:identifier>
    <dc:identifier>ISBN:0192802380</dc:identifier>
    <dc:publisher>Oxford University Press, USA</dc:publisher>
    <dc:subject>Fiction</dc:subject>
    <dc:title>Pride and Prejudice</dc:title>
    <dc:title>A Novel</dc:title>
  </entry>
</feed>

当然,这个协议提供了一些与本书相关的开销信息(比如在Google Books上是否可见等)

关于python - 将书作者分类为小说还是非小说,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4905268/

10-11 09:24