statement 1.9.7 → 1.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/statement/scraper.rb +5 -4
- data/lib/statement/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87d85f7b50d23a90cbdaa02909c6361ec6408afe
|
4
|
+
data.tar.gz: 2d30a1e96a897bc211d62c9ed115f8f4eb9495e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73695668ceca19e07c15001a397a6d67c163faa97fe9023ecae61a3a3200ca507d7b9e9afe5a219c6dc4297d933ef3839502ee823f4aa6efd34cf13e758ff222
|
7
|
+
data.tar.gz: ee18e827c2fac4a6b11e13ca2f7c8b6eff5bed5d4b253710906ee8a834f3f4f5fe13fd03bf6a208530279963767e14a6f0de468440d7ede105004c81a0fbb259
|
data/lib/statement/scraper.rb
CHANGED
@@ -284,10 +284,11 @@ module Statement
|
|
284
284
|
results
|
285
285
|
end
|
286
286
|
|
287
|
-
def self.cold_fusion(year=Date.today.year, month=nil)
|
287
|
+
def self.cold_fusion(year=Date.today.year, month=nil, skip_domains=[])
|
288
288
|
results = []
|
289
289
|
year = Date.today.year if not year
|
290
|
-
domains = ['www.ronjohnson.senate.gov','www.risch.senate.gov', 'www.lee.senate.gov', 'www.barrasso.senate.gov']
|
290
|
+
domains = ['www.ronjohnson.senate.gov','www.risch.senate.gov', 'www.lee.senate.gov', 'www.barrasso.senate.gov', 'www.heitkamp.senate.gov']
|
291
|
+
domains = domains - skip_domains if skip_domains
|
291
292
|
domains.each do |domain|
|
292
293
|
if domain == 'www.risch.senate.gov'
|
293
294
|
if not month
|
@@ -310,7 +311,7 @@ module Statement
|
|
310
311
|
end
|
311
312
|
doc = Statement::Scraper.open_html(url)
|
312
313
|
return if doc.nil?
|
313
|
-
if domain == 'www.lee.senate.gov' or domain == 'www.barrasso.senate.gov'
|
314
|
+
if domain == 'www.lee.senate.gov' or domain == 'www.barrasso.senate.gov' or domain == "www.heitkamp.senate.gov"
|
314
315
|
rows = doc.xpath("//tr")[1..-1]
|
315
316
|
else
|
316
317
|
rows = doc.xpath("//tr")[2..-1]
|
@@ -319,7 +320,7 @@ module Statement
|
|
319
320
|
date_text, title = row.children.map{|c| c.text.strip}.reject{|c| c.empty?}
|
320
321
|
next if date_text == 'Date' or date_text.size > 10
|
321
322
|
date = Date.parse(date_text)
|
322
|
-
|
323
|
+
scraped << { :source => url, :url => row.children[3].children.first['href'], :title => title, :date => date, :domain => domain }
|
323
324
|
end
|
324
325
|
end
|
325
326
|
results.flatten
|
data/lib/statement/version.rb
CHANGED