我想编写一个 Java 函数grabTopResults(String f)
,以便grabTopResults("automata theory")
为我返回一个在 Academic.google.com 上为“自动机理论”引用的前 100 篇论文的列表。
有人对哪些图书馆能让我的生活更轻松有什么建议吗?
谢谢!
我想编写一个 Java 函数grabTopResults(String f)
,以便grabTopResults("automata theory")
为我返回一个在 Academic.google.com 上为“自动机理论”引用的前 100 篇论文的列表。
有人对哪些图书馆能让我的生活更轻松有什么建议吗?
谢谢!
我使用http://jericho.htmlparser.net/docs/index.html。Google Scholar 没有 API ( http://code.google.com/p/google-ajax-apis/issues/detail?id=109 )。谷歌当然不允许(阅读使用条款。禁止自动请求者)。
下面是一些示例代码,它使用开源产品TestPlan获取第一页上的标题。它是一个独立的产品,但如果您真的需要它,我可以帮助您将它集成到您的 Java 代码中(它是用 Java 本身编写的)。
GotoURL http://scholar.google.com/
SubmitForm with
%Params:q% automate theory
end
set %Items% as response //div[@class='gs_r']
foreach %Item% in %Items%
set %Title% as selectIn %Item% h3
Notice %Title%
end
这会产生如下输出(我的 IP 是德国,因此是德国的回应)。显然,您可以根据需要对其进行格式化,或者将其写入文件;这只是一个粗略的测试。
00000000-00 GOTOURL http://scholar.google.com/
00000001-00 SUBMITFORM default
00000002-00 NOTICE [ZITATION] Stochastic complexity in statistical inquiry theory
00000003-00 NOTICE AUTOMATED THEORY FORMATION IN MATHEMATICS1
00000004-00 NOTICE Constraint generation via automated theory formation
00000005-00 NOTICE [BUCH] Automated theorem proving: after 25 years
00000006-00 NOTICE [BUCH] Introduction to the Theory of Computation
00000007-00 NOTICE [ZITATION] Computer-controlled systems: theory and design
00000008-00 NOTICE [BUCH] … , randomness & incompleteness: papers on algorithmic information theory
00000009-00 NOTICE [BUCH] Automatic control systems
00000010-00 NOTICE [BUCH] VLSI physical design automation: theory and practice
00000011-00 NOTICE Singular Control Systems.