自动化书籍引用搜索 [英] Automating book citation search
问题描述
我有一份书目清单,按照其标题在文本文件中列出。我想编写一个脚本,可以使用Google学者或亚马逊这样的Web服务来搜索这些书籍,并为每本书返回一个带有引用信息的xml或bibtex文件。
我可以使用哪种编程工具进行这种自动搜索? 解决方案
Python是我的建议。 p>
- 从文本文件获取名字,读取简单文件 google的书 API
http://books.google.com/books/feeds/volumes?q=Elizabeth+Bennet&start-index=21&max-results=10
-
简单的python代码从这个URL获取数据(可能需要一个API密钥,建议使用urllib2进行错误处理而不是urllib)
示例代码,
导入urllib
url ='http:/ /foo.api.request'
data = urllib.urlopen(url).read()
- 查看此API的返回模式(不管您喜欢如何使用XML)。
-
-
$ bHTH
$ b在两种格式之间转换请参阅BibTeXML。 $ bI have a list of books listed by their titles in a text file. I want to write a script which can use a web service like Google scholar or amazon to search for the books and return me a xml or bibtex file with citation info for each book. Which programming tools can I use for this kind of automated search ?
解决方案Python would be my recommendation.
- Get names from the text file, simple file reading
Construct a REST URL request to google's book API
http://books.google.com/books/feeds/volumes?q=Elizabeth+Bennet&start-index=21&max-results=10
Simple python code to get data from this URL (may need an API key, would advise using urllib2 with error handling rather than urllib)
Sample code,
import urllib url = 'http://foo.api.request' data = urllib.urlopen(url).read()
- See the return schemas for this API (you can use the XML however you like).
- See BibTeXML for conversion between the two formats.
HTH
这篇关于自动化书籍引用搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!