inc_5000_list_scraper 0.0.2 → 0.1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inc_5000_list_scraper.rb +16 -4
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1fdabaa64a2333f6504d053c4b023ecb4d20de2b0e510cd85a47c2ce9fb4644
4
- data.tar.gz: 2a18dbf526443ddf96512e37566777384560eddfac878a589e84cd2a01d829a1
3
+ metadata.gz: 459135592174410984a9839d864481e74c9e3259948fd4a2f04579a6fb8a7818
4
+ data.tar.gz: f2ed0a25e147973eafe3452c488f7b54d501289c00175c1fde06f7c618f3d725
5
5
  SHA512:
6
- metadata.gz: a395975a49afc72336caa9efb9bcc424d839b4eec3b1618d2adbe64c32c506863d275da337a97bee244bb6f8bbd7bf15fb30ab00b4548ef5fb84e84345fbdf62
7
- data.tar.gz: 410e1de2d4b2f5ca41d45df423034b66f43894e0665178a415784bc7321371d4424810eb45769e998d42a97e8da0c130353f951883eac5b034b8c8f15df06667
6
+ metadata.gz: 51242ae5c57bc897e340479a2a7a5aa35c91df99ddf7be9f8f3d37594d42072819cd8138174592f4414bb5f0a498cb18c3dd86e881aac26ea66b49f2a9c494e6
7
+ data.tar.gz: 065c6f352674c372226a4bd22bd56c13eb9aef69e2f56120f96acb68292403453a730a4c1840b99a8d77c34de01bfcbdf2ecd20bbe1ee7cbb1d3ce65a4e6ec54
@@ -1,9 +1,13 @@
1
1
  module Inc5000List
2
2
  class Scraper
3
- INC_LIST_REST_URI = 'https://www.inc.com/rest/i5list/2020'.freeze
3
+ INC_LIST_REST_URI = 'https://www.inc.com/rest/i5list/'.freeze
4
4
 
5
- def self.create_csv!
6
- new.scrape!
5
+ def self.create_csv!(year = nil)
6
+ new(year).scrape!
7
+ end
8
+
9
+ def initialize(year = nil)
10
+ @year = year.to_s
7
11
  end
8
12
 
9
13
  def scrape!
@@ -17,7 +21,7 @@ module Inc5000List
17
21
  end
18
22
 
19
23
  def list_as_text
20
- OpenURI.open_uri(INC_LIST_REST_URI).read
24
+ OpenURI.open_uri(url).read
21
25
  end
22
26
 
23
27
  def list_as_json
@@ -37,5 +41,13 @@ module Inc5000List
37
41
  website: company.website
38
42
  }
39
43
  end
44
+
45
+ def url
46
+ INC_LIST_REST_URI + year
47
+ end
48
+
49
+ def year
50
+ @year.present? ? @year : '2020'
51
+ end
40
52
  end
41
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inc_5000_list_scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-12 00:00:00.000000000 Z
11
+ date: 2020-10-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: Bryan@Thompson.codes
@@ -36,9 +36,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  requirements: []
39
- rubygems_version: 3.0.8
39
+ rubygems_version: 3.1.2
40
40
  signing_key:
41
41
  specification_version: 4
42
- summary: inc_5000_list_scraper scrapes the 2020 Inc 5000 list and outputs a csv of
43
- the list
42
+ summary: inc_5000_list_scraper scrapes the Inc 5000 list and outputs a csv of the
43
+ list
44
44
  test_files: []