国际标准书号 -> bookdata 查找以填充数据库
好的,我想为一个小型图书馆建立数据库。
我对数据库的经验有限,并且没有从网络服务器查询的经验。
我想要检索标题、出版商、也许是作者、描述等信息 我能想到的最简单的方法是通过 ISBN 查找它们。
我以前接触过 isbndb.com,但访问它的 API 似乎相当复杂。
我想知道我应该如何去做这件事。
Ok, I wanting to database a small library.
I've only had limited experience with databases, and none with querying from a webserver.
I'm going to want to retrieve information like title, Publisher, maybe author, description
the simplest way I can think of dooing this is looking them up via the ISBN.
I've come across isbndb.com before, but the API for accessing it seems rather complex.
I'm wondering how I should go about doing this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
ISBNdb.com API 看起来很简单。以下请求应检索您想要的信息...只需将您的访问密钥替换为“YourKey”,并将 ISBN 替换为“YourISBN”。
响应是 XML,其中包含有关您提交的 ISBN 的单本书的信息。
The ISBNdb.com API looks simple. The following request should retrieve the information you want ... just substitute your access key for "YourKey" and the ISBN for "YourISBN".
The response is XML which contains information about the single book whose ISBN you submitted.
最近,当我们出于保险目的对图书馆进行索引时,我必须这样做。下面是我一起破解的 vba 类的代码:
获取 API 密钥,将上面的代码(使用您的密钥)粘贴到 VBA 编辑器中的新类模块中(插入 -> 类模块)并将该模块命名为“isbn” 。您还需要在 VBA 编辑器中添加对“Microsoft XML”的引用(工具 -> 参考)
您可以在普通的 vba 模块中使用下面的代码片段测试它的工作情况:
然后只需在立即窗口中键入“testlookup”(查看->立即窗口)。您应该看到这样的响应:
isbnDB 可以返回比我在上面的类中收集的数据更多的数据,请在此处阅读 API 参考:http://isbndb.com/docs/api/ 并根据您的需求定制课程。
我发现这篇文章对于解释如何在 access 中使用 xmlhttp 非常有帮助:
http://www.15seconds.com/issue/991125.htm
上的 msdn 页面XML DOM 方法和 XMLHttpRequest 对象也很有用(因为我是新用户,我只能发布两个活动链接,您必须替换下面网址中的点):
msdn microsoft com/en-us/library/ms757828 (v=VS.85).aspx
msdn microsoft com/en-us/library/ms535874(v=vs.85).aspx
I recently had to do exactly this as we indexed our library for insurance purposes. Below is the code of the vba class I hacked together:
Get an API key, paste the above code (with your key) into a new class module in the VBA editor (Insert->Class Module) and name the module "isbn". You also need to add a reference to "Microsoft XML" in the VBA editor (Tools->References)
You can test it works with the code snippet below in a normal vba module:
Then just type "testlookup" into the immediate window (View->Immediate Window). You should see a response of:
isbnDB can return more than the data I collect in the above class, read the API reference here: http://isbndb.com/docs/api/ and tailor the class to your needs.
I found this article very helpful in explaining how to use xmlhttp from within access:
http://www.15seconds.com/issue/991125.htm
The msdn pages on XML DOM Methods and XMLHttpRequest Object were also useful (because I'm a new user I can only post two active links, you'll have to replace the dots in the urls below):
msdn microsoft com/en-us/library/ms757828(v=VS.85).aspx
msdn microsoft com/en-us/library/ms535874(v=vs.85).aspx
您使用什么语言?您需要一个程序/脚本来呈现一个可以输入 ISBN 的表单,然后该表单将从 isbndb.com 获取数据并填充数据库。我使用过该 API,但已经有一段时间了,而且它非常简单。
What language are you using? You need a program/script to present a form where you can enter the ISBN, which would then get the data from isbndb.com and populate the database. I've used the API a bit, but not for some time, and it's pretty straightforward.
这是一个不完整的答案,但它应该可以帮助您入门(我没有使用 XML 数据作为返回)。
此代码具有基础知识:
来自网页的响应位于 XMLHTTP 对象的 .responseText 属性中。你如何处理这个超出了我的范围。我知道一位 Access 新闻组专家发布了有关使用 Access Web 服务的教程,但我找不到它。本文可能与该问题有关:
http://support.microsoft.com /kb/285329/en-us
This is an incomplete answer, but it should get you started (I've not worked with XML data as return).
This code has the basics:
The response from the web page is in the .responseText property of the XMLHTTP object. How you process that is beyond me. I know that one of the Access newsgroup gurus has published a tutorial on consuming web services from Access, but I can't locate it. This article might have something to do with the issue:
http://support.microsoft.com/kb/285329/en-us
您可以使用美国国会图书馆的 MARC21 XML。
我做了和你一样的事情,建立了一个数据库来容纳我的图书馆。扫描 ISBN 会从此 URL 收集数据
http://z3950.loc。 gov:7090/voyager?version=1.1&operation=searchRetrieve&query=YOUR_ISBN&maximumRecords=1
然后,响应数据将填写包含所有数据的表单。您不需要帐户,只需要该 URL。
响应采用 XML 形式(如前所述),您可以使用任何您想要的语言从那里进行解析(我的选择恰好是 PHP)。
You can use the MARC21 XML from the Library of Congress.
I did the same thing as you, building a database to house my library. Scanning in the ISBN collects the data from this URL
http://z3950.loc.gov:7090/voyager?version=1.1&operation=searchRetrieve&query=YOUR_ISBN&maximumRecords=1
The response data then fills in a form with all the data. You don't need an account, just that URL.
The response comes in XML (as mentioned), and you can parse from there using whatever language you want (my choice happens to be PHP).