statement 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,7 +29,7 @@ module Statement
29
29
  end
30
30
 
31
31
  def self.member_methods
32
- [:capuano, :cold_fusion, :conaway, :susandavis, :faleomavaega, :freshman_senators, :klobuchar, :lujan, :billnelson, :lautenberg, :crapo, :coburn, :boxer, :mccain, :vitter_cowan, :donnelly, :inhofe, :levin, :reid, :palazzo, :document_query, :farenthold]
32
+ [:capuano, :cold_fusion, :conaway, :susandavis, :faleomavaega, :freshman_senators, :klobuchar, :lujan, :billnelson, :lautenberg, :crapo, :coburn, :boxer, :mccain, :vitter, :donnelly, :inhofe, :levin, :reid, :palazzo, :document_query, :farenthold]
33
33
  end
34
34
 
35
35
  def self.committee_methods
@@ -40,14 +40,14 @@ module Statement
40
40
  year = Date.today.year
41
41
  results = [freshman_senators, capuano, cold_fusion(year, 0), conaway, susandavis, faleomavaega, klobuchar, lujan, palazzo(page=1), billnelson(year=year),
42
42
  document_query(page=1), document_query(page=2), farenthold(year), donnelly(year=year), crapo, coburn, boxer(start=1), mccain(year=year),
43
- vitter_cowan(year=year), inhofe(year=year), reid].flatten
43
+ vitter(year=year), inhofe(year=year), reid].flatten
44
44
  Utils.remove_generic_urls!(results)
45
45
  end
46
46
 
47
47
  def self.backfill_from_scrapers
48
48
  results = [cold_fusion(2012, 0), cold_fusion(2011, 0), cold_fusion(2010, 0), billnelson(year=2012), document_query(page=3),
49
49
  document_query(page=4), coburn(year=2012), coburn(year=2011), coburn(year=2010), boxer(start=11), boxer(start=21),
50
- boxer(start=31), boxer(start=41), mccain(year=2012), mccain(year=2011), vitter_cowan(year=2012), vitter_cowan(year=2011),
50
+ boxer(start=31), boxer(start=41), mccain(year=2012), mccain(year=2011), vitter(year=2012), vitter(year=2011),
51
51
  ].flatten
52
52
  Utils.remove_generic_urls!(results)
53
53
  end
@@ -418,24 +418,17 @@ module Statement
418
418
  results
419
419
  end
420
420
 
421
- def self.vitter_cowan(year=Date.today.year)
421
+ def self.vitter(year=Date.today.year)
422
422
  results = []
423
- urls = ["http://www.vitter.senate.gov/newsroom/", "http://www.cowan.senate.gov/"]
424
- urls.each do |url|
425
- next if year < 2013 and url == "http://www.cowan.senate.gov/"
426
- if url == "http://www.vitter.senate.gov/newsroom/"
427
- domain = "www.vitter.senate.gov"
428
- elsif url == "http://www.cowan.senate.gov/"
429
- domain = "www.cowan.senate.gov"
430
- end
431
- doc = open_html(url+"press?year=#{year}")
432
- return if doc.nil?
433
- doc.xpath("//tr")[1..-1].each do |row|
434
- next if row.text.strip.size < 30
435
- results << { :source => url, :url => row.children[2].children[0]['href'].strip, :title => row.children[2].text, :date => Date.strptime(row.children[0].text, "%m/%d/%y"), :domain => domain}
436
- end
423
+ url = "http://www.vitter.senate.gov/newsroom/"
424
+ domain = "www.vitter.senate.gov"
425
+ doc = open_html(url+"press?year=#{year}")
426
+ return if doc.nil?
427
+ doc.xpath("//tr")[1..-1].each do |row|
428
+ next if row.text.strip.size < 30
429
+ results << { :source => url, :url => row.children[2].children[0]['href'].strip, :title => row.children[2].text, :date => Date.strptime(row.children[0].text, "%m/%d/%y"), :domain => domain}
437
430
  end
438
- results.flatten
431
+ results
439
432
  end
440
433
 
441
434
  def self.donnelly(year=Date.today.year)
@@ -1,3 +1,3 @@
1
1
  module Statement
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
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: 1.0.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-03 00:00:00.000000000 Z
12
+ date: 2013-07-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  segments:
216
216
  - 0
217
- hash: 3610372515894260046
217
+ hash: -1372506109744034724
218
218
  required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  none: false
220
220
  requirements:
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  version: '0'
224
224
  segments:
225
225
  - 0
226
- hash: 3610372515894260046
226
+ hash: -1372506109744034724
227
227
  requirements: []
228
228
  rubyforge_project:
229
229
  rubygems_version: 1.8.25