statement 1.8.5 → 1.8.6
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 +3 -5
- 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: f777f657b5861f10eb1731a84ba45e85a7d2a401
|
4
|
+
data.tar.gz: 2c36d668c73097b0108ea0fa66d1a236c597f63c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d58a345789e59a07f5aa4bab2f7c6ce369242b0fae9508df85565c0f0c0b67286eca88e4ba8119a64cf1227ebfcd295688c822c25af52ca8ed2b2022b5d0f74
|
7
|
+
data.tar.gz: 205ed57eb16bfab790ac6fa549e54efb79b76f49a777c3be5d05a4d673cff1245c81dd058f8190801110ff08c57897bb72876b5d61a5c1c558f81b2d01bd887c
|
data/lib/statement/scraper.rb
CHANGED
@@ -262,22 +262,20 @@ module Statement
|
|
262
262
|
results = []
|
263
263
|
year = Date.today.year if not year
|
264
264
|
month = 0 if not month
|
265
|
-
domains = ['crenshaw.house.gov', 'www.ronjohnson.senate.gov/public/','www.
|
265
|
+
domains = ['crenshaw.house.gov', 'www.ronjohnson.senate.gov/public/','www.risch.senate.gov/public/']
|
266
266
|
domains.each do |domain|
|
267
267
|
if domain == 'crenshaw.house.gov' or domain == 'www.risch.senate.gov/public/'
|
268
268
|
url = "http://"+domain + "/index.cfm/pressreleases?YearDisplay=#{year}&MonthDisplay=#{month}&page=1"
|
269
|
-
elsif domain == 'www.moran.senate.gov/public/'
|
270
|
-
url = "http://"+domain + "index.cfm/news-releases?YearDisplay=#{year}&MonthDisplay=#{month}&page=1"
|
271
269
|
else
|
272
270
|
url = "http://"+domain + "index.cfm/press-releases?YearDisplay=#{year}&MonthDisplay=#{month}&page=1"
|
273
271
|
end
|
274
|
-
doc = open_html(url)
|
272
|
+
doc = Statement::Scraper.open_html(url)
|
275
273
|
return if doc.nil?
|
276
274
|
doc.xpath("//tr")[2..-1].each do |row|
|
277
275
|
date_text, title = row.children.map{|c| c.text.strip}.reject{|c| c.empty?}
|
278
276
|
next if date_text == 'Date' or date_text.size > 10
|
279
277
|
date = Date.parse(date_text)
|
280
|
-
results << { :source => url, :url => row.children[
|
278
|
+
results << { :source => url, :url => row.children[3].children.first['href'], :title => title, :date => date, :domain => domain }
|
281
279
|
end
|
282
280
|
end
|
283
281
|
results.flatten
|
data/lib/statement/version.rb
CHANGED