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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25553002722db90afdfbbe461dc9a3ec0275ee60
4
- data.tar.gz: d4ee92e093c6226862e301ea6f0d0479bc85b72d
3
+ metadata.gz: d33587cd7883a05bd9e01b6f06c73729fdeb1d6b
4
+ data.tar.gz: 4bbba1651ac1d0074edc3bb07775682dfa8b6517
5
5
  SHA512:
6
- metadata.gz: 5d86f2900b6db1d04e66afdeb51cc7c85a09e59871c42b93796702e4f585a4e6af3df7a115ee060c7e5df3a72a8624d189ce708f91995ae8a5bc64dd34d0e6bc
7
- data.tar.gz: 6212063829bb9703cd098ce7133e5c00bc87fe0684dd4875fe1313c803b27e774a981e68756db2cb2d3c949ea3020e8e99d5136bd56273f4d14e2f271bf53bcd
6
+ metadata.gz: 80cbd6641b31166b41d751978943a437ca993537592cbfdb973e8f4eb03c6a9c4cef71ef512f9b8d013eca8aee4fae70ce8db8bde65969b800fa2ed1cf32bb78
7
+ data.tar.gz: aa35ff169a30118de4d500eb36bce8fbf98e8b9d3fa9a18f6717b5237e1be299488829f854306756d4bdd4beed12a02e7e3b2368eab2e51d7f8ef5926d591d15
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gscholar"
8
- s.version = "0.1.6"
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-08"
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 = [
@@ -20,9 +20,11 @@ module GScholar
20
20
 
21
21
  def citations(range = nil)
22
22
  rst = []
23
- rst += Utils.fetch(citations_url(rst.size)).links_with(:text => "Import into BibTeX").
24
- map {|link| Citation.new(link.href[/info:([^:]+):/, 1]) } until rst.size == cited
25
- rst
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.6
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-08 00:00:00.000000000 Z
11
+ date: 2014-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize