gared 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gared/idea.rb +32 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8459865216cd87441be5b4b8077bb4d2a1796eab7a7e7949ab0c7f366ba17454
|
4
|
+
data.tar.gz: 69cbdabc561474f27133d99a29848e570e8463534e559f3f40757b368014c0b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7621514e31459ceea5bbe01fb5e29a9274c044b8f695645852fed95a3f777e5b991659338a50ee83dae0eca571e21538f655e6fa1c49b083b17aabfeac87e51a
|
7
|
+
data.tar.gz: e9ffaadf371c999ccaf8aff79df49eb01eb86cf15675505efb0fc91b2f0a4c9537de0462812d6f1f9390892b5bfd6802d496846dd5891dc864d2cd003bbdebaa
|
data/lib/gared/idea.rb
CHANGED
@@ -27,20 +27,35 @@ module Gared
|
|
27
27
|
@browser.input(id: 'cb_update_0').click # "quick search" - not necessarily by author!
|
28
28
|
@browser.wait
|
29
29
|
ret = []
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
30
|
+
begin
|
31
|
+
results = @browser.div(id: 'results_list')
|
32
|
+
if results.exists?
|
33
|
+
# total = @browser.div(:class => 'resultSum').text.scan(/מתוך\s+(\d+)/)[0][0].to_i
|
34
|
+
stop = false
|
35
|
+
until stop do
|
36
|
+
trs = @browser.div(id: 'results_list').table.rows
|
37
|
+
if trs.size > 0
|
38
|
+
trs.each do |tr|
|
39
|
+
item = tr.tr.tds[1]
|
40
|
+
urlpart = item.h5.a.href
|
41
|
+
p = Publication.new
|
42
|
+
p.title = item.ps[0].text # first line is always the title. After that, all bets are off...
|
43
|
+
item.ps.each{|para|
|
44
|
+
st = para.text.strip
|
45
|
+
p.author_line = st.sub('מחבר: ','') if st =~ /^מחבר:/
|
46
|
+
p.pub_year = st.sub('שנה לועזית:','').sub('שנת הוצאה:','') if st =~ /^שנה לועזית:/ or st =~ /^שנת הוצאה:/
|
47
|
+
}
|
48
|
+
p.source_id = urlpart
|
49
|
+
ret << p
|
50
|
+
end
|
51
|
+
nextlink = @browser.a(title: 'הבא')
|
52
|
+
if nextlink.exists?
|
53
|
+
nextlink.click
|
54
|
+
@browser.wait
|
55
|
+
else
|
56
|
+
stop = true
|
57
|
+
end
|
58
|
+
end
|
44
59
|
end
|
45
60
|
# now that we've extracted everything useful from this page, iterate over the results to pick up the system ID
|
46
61
|
ret.each do |item|
|
@@ -53,11 +68,12 @@ module Gared
|
|
53
68
|
h.source_id = item.source_id
|
54
69
|
h.source_name = @options[:opac_url]
|
55
70
|
item.add_holding(h)
|
56
|
-
end
|
71
|
+
end
|
57
72
|
end
|
73
|
+
rescue Exception
|
74
|
+
puts $!
|
58
75
|
end
|
59
76
|
return ret
|
60
|
-
# TODO: support multiple result pages
|
61
77
|
end
|
62
78
|
end
|
63
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gared
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Asaf Bartov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zoom
|