statement 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Statement
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
data/lib/statement.rb CHANGED
@@ -30,7 +30,7 @@ module Statement
30
30
  end
31
31
 
32
32
  def self.date_from_rss_item(link)
33
- if !link.xpath('pubDate').empty?
33
+ if !link.xpath('pubDate').text.blank?
34
34
  Date.parse(link.xpath('pubDate').text)
35
35
  elsif !link.xpath('pubdate').empty?
36
36
  Date.parse(link.xpath('pubdate').text)
@@ -64,7 +64,7 @@ module Statement
64
64
 
65
65
  def self.from_scrapers
66
66
  year = Date.today.year
67
- [freshman_senators, capuano, cold_fusion(year, 0), conaway, susandavis, faleomavaega, klobuchar, lujan, billnelson(year=year),
67
+ [freshman_senators, capuano, cold_fusion(year, 0), conaway, susandavis, faleomavaega, klobuchar, lujan, palazzo(page=1), billnelson(year=year),
68
68
  document_query(page=1), document_query(page=2), lautenberg, crapo, coburn, boxer(start=1), mccain(year=year),
69
69
  vitter_cowan(year=year), inhofe(year=year), reid].flatten
70
70
  end
@@ -323,6 +323,18 @@ module Statement
323
323
  results
324
324
  end
325
325
 
326
+ def self.palazzo(page=1)
327
+ results = []
328
+ domain = "palazzo.house.gov"
329
+ url = "http://palazzo.house.gov/news/documentquery.aspx?DocumentTypeID=2519&Page=#{page}"
330
+ doc = open_html(url)
331
+ return if doc.nil?
332
+ doc.xpath("//div[@class='middlecopy']//li").each do |row|
333
+ results << { :source => url, :url => "http://palazzo.house.gov/news/" + row.children[1]['href'], :title => row.children[1].text.strip, :date => Date.parse(row.children[3].text.strip), :domain => domain }
334
+ end
335
+ results
336
+ end
337
+
326
338
  def self.document_query(page=1)
327
339
  results = []
328
340
  domains = [{"roe.house.gov" => 1532}, {"thornberry.house.gov" => 1776}, {"wenstrup.house.gov" => 2491}]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statement
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  segments:
131
131
  - 0
132
- hash: 4139166016064656408
132
+ hash: 2838603504965451110
133
133
  required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  none: false
135
135
  requirements:
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  segments:
140
140
  - 0
141
- hash: 4139166016064656408
141
+ hash: 2838603504965451110
142
142
  requirements: []
143
143
  rubyforge_project:
144
144
  rubygems_version: 1.8.24