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.
- checksums.yaml +4 -4
- data/lib/inc_5000_list_scraper.rb +16 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 459135592174410984a9839d864481e74c9e3259948fd4a2f04579a6fb8a7818
|
4
|
+
data.tar.gz: f2ed0a25e147973eafe3452c488f7b54d501289c00175c1fde06f7c618f3d725
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
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(
|
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
|
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-
|
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.
|
39
|
+
rubygems_version: 3.1.2
|
40
40
|
signing_key:
|
41
41
|
specification_version: 4
|
42
|
-
summary: inc_5000_list_scraper scrapes the
|
43
|
-
|
42
|
+
summary: inc_5000_list_scraper scrapes the Inc 5000 list and outputs a csv of the
|
43
|
+
list
|
44
44
|
test_files: []
|