ecfs 0.4.1 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa5da38c0c5348fa0c845d28c0f9c2516cf33bb3
4
- data.tar.gz: 30aed783337f289d994d490d26240bb43b6266e4
3
+ metadata.gz: c1a6dcf7a11a8fe5074e894553719aea9451fc6f
4
+ data.tar.gz: e2edf307df0346fb87ee5e8328f4b830fa7adc5f
5
5
  SHA512:
6
- metadata.gz: e91e0878401399171a6f346d72049a3d3c71975d2a6ca1671e7775a8f49e5a7bfac62e84765a7ec27b500e95599c2a8df77e684fe3e4885ee2e0a1dc9446432e
7
- data.tar.gz: 0fd4b2971174f2c3317016d85282a056b046ea3f06702349b92de6b5f50804ddf35591aa0e41f10f70e260fbfe28d009e2e2147cf3e8fd1eaa73b8ab960d4d41
6
+ metadata.gz: 2577e742cacbaaff43926f6f69302cb7e4172b62e56bfd7717f670d6c2140f868bc84ecfd3d04a543bdb3456d59a8a260683306b2686e7636e1d17102af1cbd9
7
+ data.tar.gz: e39b2abf1052849b29a8a5e672758ffc508009ff62cdff395c490cd46e02e4372d68ba78cd72c9ee4709d0d661bdbef2af79d47b7f56e8a5da255ce8430a9214
@@ -9,6 +9,25 @@ module ECFS
9
9
  attr_accessor :received_min_date
10
10
  attr_accessor :after_scrape
11
11
 
12
+ def filing_to_citation(filing)
13
+ patterns = {
14
+ "COMMENT" => "Comments",
15
+ "REPLY TO COMMENTS" => "Reply Comments",
16
+ "NOTICE OF EXPARTE" => "Ex Parte Letter"
17
+ }
18
+
19
+ case filing["type_of_filing"]
20
+ when "COMMENT"
21
+ return "Comments of #{filing['name_of_filer']}"
22
+ when "REPLY TO COMMENTS"
23
+ return "Reply Comments of #{filing['name_of_filer']}"
24
+ when "NOTICE OF EXPARTE"
25
+ return "#{filing['name_of_filer']} Ex Parte Letter"
26
+ else
27
+ return "#{filing["type_of_filing"].downcase.capitalize} of #{filing['name_of_filer']}"
28
+ end
29
+ end
30
+
12
31
  def filings_from_docket_number(docket_number, start=0, received_min_date=nil, after_scrape=nil)
13
32
  url = "http://apps.fcc.gov/ecfs/solr/search?sort=dateRcpt&proceeding=#{docket_number}&dir=asc&start=#{start}"
14
33
 
@@ -47,6 +66,10 @@ module ECFS
47
66
  }
48
67
  end
49
68
 
69
+ filings.each do |filing|
70
+ filing['citation'] = filing_to_citation(filing)
71
+ end
72
+
50
73
  if after_scrape
51
74
  after_scrape.call(filings)
52
75
  end
@@ -54,25 +77,6 @@ module ECFS
54
77
  return filings, total
55
78
  end
56
79
 
57
- def filing_to_citation(filing)
58
- patterns = {
59
- "COMMENT" => "Comments",
60
- "REPLY TO COMMENTS" => "Reply Comments",
61
- "NOTICE OF EXPARTE" => "Ex Parte Letter"
62
- }
63
-
64
- case filing["type_of_filing"]
65
- when "COMMENT"
66
- return "Comments of #{filing['name_of_filer']}"
67
- when "REPLY TO COMMENTS"
68
- return "Reply Comments of #{filing['name_of_filer']}"
69
- when "NOTICE OF EXPARTE"
70
- return "#{filing['name_of_filer']} Ex Parte Letter"
71
- else
72
- return "#{filing["type_of_filing"].downcase.capitalize} of #{filing['name_of_filer']}"
73
- end
74
- end
75
-
76
80
  def get
77
81
  url = "http://apps.fcc.gov/ecfs/solr/search?sort=dateRcpt&proceeding=#{@docket_number}&dir=asc&start=0"
78
82
  filings = []
@@ -87,10 +91,6 @@ module ECFS
87
91
  pages.each do |page|
88
92
  filings.concat filings_from_docket_number(@docket_number, page, @received_min_date, @after_scrape)[0]
89
93
  end
90
-
91
- filings.each do |filing|
92
- filing['citation'] = filing_to_citation(filing)
93
- end
94
94
 
95
95
  filings
96
96
  end
@@ -1,3 +1,3 @@
1
1
  module ECFS
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -26,6 +26,7 @@ class TestSolrScrape < MiniTest::Unit::TestCase
26
26
  assert filings.first.is_a?(Hash)
27
27
  assert filings.first.has_key?('docket_number')
28
28
  assert filings.first.has_key?('citation')
29
+ assert filings.first
29
30
 
30
31
  filing_date = DateTime.strptime(filings.first['date_received'], "%m/%d/%Y")
31
32
  min_date = DateTime.strptime('11/28/14', "%m/%d/%Y")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan deLevie