gscholar 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/gscholar.gemspec +2 -2
- data/lib/gscholar/paper.rb +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d33587cd7883a05bd9e01b6f06c73729fdeb1d6b
|
4
|
+
data.tar.gz: 4bbba1651ac1d0074edc3bb07775682dfa8b6517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80cbd6641b31166b41d751978943a437ca993537592cbfdb973e8f4eb03c6a9c4cef71ef512f9b8d013eca8aee4fae70ce8db8bde65969b800fa2ed1cf32bb78
|
7
|
+
data.tar.gz: aa35ff169a30118de4d500eb36bce8fbf98e8b9d3fa9a18f6717b5237e1be299488829f854306756d4bdd4beed12a02e7e3b2368eab2e51d7f8ef5926d591d15
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.7
|
data/gscholar.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "gscholar"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Zifei Tong"]
|
12
|
-
s.date = "2014-01-
|
12
|
+
s.date = "2014-01-11"
|
13
13
|
s.description = "A library for fetching author, paper and citation information for Google Scholar"
|
14
14
|
s.email = "soariez@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/gscholar/paper.rb
CHANGED
@@ -20,9 +20,11 @@ module GScholar
|
|
20
20
|
|
21
21
|
def citations(range = nil)
|
22
22
|
rst = []
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
while true
|
24
|
+
links = Utils.fetch(citations_url(rst.size, range)).links_with(:text => "Import into BibTeX")
|
25
|
+
return rst if links.empty?
|
26
|
+
rst += links.map {|link| Citation.new(link.href[/info:([^:]+):/, 1]) }
|
27
|
+
end
|
26
28
|
end
|
27
29
|
|
28
30
|
private
|
@@ -34,8 +36,8 @@ module GScholar
|
|
34
36
|
"http://scholar.google.com/scholar?cluster=#{@id}"
|
35
37
|
end
|
36
38
|
|
37
|
-
def citations_url(start = 0)
|
38
|
-
"http://scholar.google.com/scholar?cites=#{@id}&num=20&start=#{start}"
|
39
|
+
def citations_url(start = 0, range = nil)
|
40
|
+
"http://scholar.google.com/scholar?cites=#{@id}&num=20&start=#{start}&as_ylo=#{range}"
|
39
41
|
end
|
40
42
|
|
41
43
|
def key
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gscholar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zifei Tong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|