sourcescrub 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -2
- data/Gemfile.lock +11 -7
- data/README.md +4 -2
- data/lib/sourcescrub/apis/companies.rb +3 -3
- data/lib/sourcescrub/client.rb +7 -7
- data/lib/sourcescrub/models/company.rb +12 -0
- data/lib/sourcescrub/models/concerns/company_items.rb +4 -3
- data/lib/sourcescrub/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d8b09fea67b65e3ff5d2d8effb6d62a695a414b3b6f650561e2c261a0071d3f
|
4
|
+
data.tar.gz: 2746a0d58773997be22eab5c4b50bb01118bad06f9c149a7f4de86aa77f314af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e460c9f06ed36b2806d808d3360eaba605e3d43254699e0c284a210bde657e6e1f7c54e18e580fa7e9a1075b51510c3071a109af58e0807770f414dfbe868468
|
7
|
+
data.tar.gz: 45f1be48446d80daa3b11f4f15d604ea9b840d1c42d256bcbf6b7018f3d26ff720cfd820c9c8a20f5c5157ebd6dd9cfdceb17b3ab4ae1f1a67512a428c8da7c7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [0.1.3] - 2024-06-17
|
4
|
+
|
5
|
+
- Get company data by SS ID - `client.company('XWO6N4OP')`
|
6
|
+
- Pull new fields of company
|
7
|
+
- threeMonthsGrowthRate
|
8
|
+
- sixMonthsGrowthRate
|
9
|
+
- nineMonthsGrowthRate
|
10
|
+
- twelveMonthsGrowthRate
|
11
|
+
- growthIntent
|
12
|
+
- customScore
|
13
|
+
- industries
|
14
|
+
- modifiedDate
|
15
|
+
- endMarkets
|
16
|
+
- productsAndServices
|
17
|
+
|
3
18
|
## [0.1.2] - 2021-01-14
|
4
19
|
|
5
20
|
- Implement search source endpoint to allow use filters to get matched sources - `client.source_search({limit: 10, offset: 0})`
|
@@ -21,8 +36,8 @@
|
|
21
36
|
## [0.0.3] - 2020-06-20
|
22
37
|
|
23
38
|
- Implement API to request token by user certificate
|
24
|
-
- Get company data by domain - `client.company(ekohe.com)`
|
25
|
-
- Get company's relationship data by domain - `client.company(ekohe.com, {card_id: 'people'})`
|
39
|
+
- Get company data by domain - `client.company('ekohe.com')`
|
40
|
+
- Get company's relationship data by domain - `client.company('ekohe.com', {card_id: 'people'})`
|
26
41
|
- Retrieve request limit data from header
|
27
42
|
|
28
43
|
```
|
data/Gemfile.lock
CHANGED
@@ -1,35 +1,38 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sourcescrub (0.1.
|
4
|
+
sourcescrub (0.1.3)
|
5
5
|
faraday
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.
|
10
|
+
addressable (2.8.0)
|
11
11
|
public_suffix (>= 2.0.2, < 5.0)
|
12
12
|
ast (2.4.1)
|
13
|
+
base64 (0.2.0)
|
13
14
|
coderay (1.1.3)
|
14
15
|
crack (0.4.3)
|
15
16
|
safe_yaml (~> 1.0.0)
|
16
17
|
diff-lcs (1.3)
|
17
|
-
faraday (
|
18
|
-
|
18
|
+
faraday (2.8.1)
|
19
|
+
base64
|
20
|
+
faraday-net_http (>= 2.0, < 3.1)
|
21
|
+
ruby2_keywords (>= 0.0.4)
|
22
|
+
faraday-net_http (3.0.2)
|
19
23
|
hashdiff (1.0.1)
|
20
24
|
method_source (1.0.0)
|
21
|
-
multipart-post (2.1.1)
|
22
25
|
parallel (1.19.2)
|
23
26
|
parser (2.7.1.3)
|
24
27
|
ast (~> 2.4.0)
|
25
28
|
pry (0.13.1)
|
26
29
|
coderay (~> 1.1)
|
27
30
|
method_source (~> 1.0)
|
28
|
-
public_suffix (4.0.
|
31
|
+
public_suffix (4.0.6)
|
29
32
|
rainbow (3.0.0)
|
30
33
|
rake (12.3.3)
|
31
34
|
regexp_parser (1.7.1)
|
32
|
-
rexml (3.2.
|
35
|
+
rexml (3.2.5)
|
33
36
|
rspec (3.9.0)
|
34
37
|
rspec-core (~> 3.9.0)
|
35
38
|
rspec-expectations (~> 3.9.0)
|
@@ -55,6 +58,7 @@ GEM
|
|
55
58
|
rubocop-ast (0.0.3)
|
56
59
|
parser (>= 2.7.0.1)
|
57
60
|
ruby-progressbar (1.10.1)
|
61
|
+
ruby2_keywords (0.0.5)
|
58
62
|
safe_yaml (1.0.5)
|
59
63
|
unicode-display_width (1.7.0)
|
60
64
|
vcr (6.0.0)
|
data/README.md
CHANGED
@@ -61,7 +61,8 @@ pry(main)> client.headers
|
|
61
61
|
|
62
62
|
```ruby
|
63
63
|
<!-- Company -->
|
64
|
-
response = client.company('ekohe.com')
|
64
|
+
response = client.company('ekohe.com') # get data by domain
|
65
|
+
response = client.company('LZ281NVD') # get data by SS ID
|
65
66
|
|
66
67
|
<!-- Get the JSON response of Company -->
|
67
68
|
|
@@ -70,7 +71,7 @@ response.as_json
|
|
70
71
|
|
71
72
|
### Companies
|
72
73
|
|
73
|
-
#### Get the company data
|
74
|
+
#### Get the company data by domain or Sourcescrub ID
|
74
75
|
|
75
76
|
```ruby
|
76
77
|
pry(main)> response = client.company('ekohe.com')
|
@@ -179,6 +180,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
179
180
|
|
180
181
|
Bug reports and pull requests are welcome on GitHub at https://github.com/ekohe/sourcescrub. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ekohe/sourcescrub/blob/master/CODE_OF_CONDUCT.md).
|
181
182
|
|
183
|
+
- [Encore](https://github.com/encoreshao)
|
182
184
|
|
183
185
|
## License
|
184
186
|
|
@@ -12,8 +12,8 @@ module Sourcescrub
|
|
12
12
|
|
13
13
|
attr_accessor :args
|
14
14
|
|
15
|
-
def initialize(
|
16
|
-
@
|
15
|
+
def initialize(identifier, args)
|
16
|
+
@identifier = identifier
|
17
17
|
@model_type = args.delete(:model_type)
|
18
18
|
@card_id = args.delete(:card_id)
|
19
19
|
@args = args
|
@@ -22,7 +22,7 @@ module Sourcescrub
|
|
22
22
|
def request_url
|
23
23
|
[
|
24
24
|
Models::Company::ENDPOINT,
|
25
|
-
@
|
25
|
+
@identifier,
|
26
26
|
@card_id
|
27
27
|
].compact.join('/')
|
28
28
|
end
|
data/lib/sourcescrub/client.rb
CHANGED
@@ -30,17 +30,17 @@ module Sourcescrub
|
|
30
30
|
)
|
31
31
|
end
|
32
32
|
|
33
|
-
def company(
|
34
|
-
api = company_api(
|
33
|
+
def company(identifier, args = {})
|
34
|
+
api = company_api(identifier, args)
|
35
35
|
|
36
36
|
api.sobject.parse_response get(api.request_url, api.args)
|
37
37
|
end
|
38
38
|
|
39
|
-
def company_cards(
|
40
|
-
api = company_api(
|
39
|
+
def company_cards(identifier, args = {})
|
40
|
+
api = company_api(identifier, args.merge(model_type: company_card_mappings[args[:card_id]]))
|
41
41
|
|
42
42
|
Models::CompanyItems.new.parse_response_items(
|
43
|
-
|
43
|
+
identifier,
|
44
44
|
api.kclass_name,
|
45
45
|
get(api.request_url, api.args)
|
46
46
|
)
|
@@ -90,9 +90,9 @@ module Sourcescrub
|
|
90
90
|
)
|
91
91
|
end
|
92
92
|
|
93
|
-
def company_api(
|
93
|
+
def company_api(identifier, args)
|
94
94
|
Apis::Companies.new(
|
95
|
-
|
95
|
+
identifier,
|
96
96
|
{ model_type: 'company' }.merge(args)
|
97
97
|
)
|
98
98
|
end
|
@@ -8,6 +8,7 @@ module Sourcescrub
|
|
8
8
|
class Company < Entity
|
9
9
|
ENDPOINT = 'companies'
|
10
10
|
|
11
|
+
# rubocop:disable Metrics/MethodLength
|
11
12
|
def field_ids
|
12
13
|
%w[
|
13
14
|
id
|
@@ -32,13 +33,24 @@ module Sourcescrub
|
|
32
33
|
linkedIn
|
33
34
|
totalAmountInvested
|
34
35
|
currentEmployeeCount
|
36
|
+
threeMonthsGrowthRate
|
37
|
+
sixMonthsGrowthRate
|
38
|
+
nineMonthsGrowthRate
|
39
|
+
twelveMonthsGrowthRate
|
35
40
|
currentEmployeeRange
|
36
41
|
currentJobOpenings
|
42
|
+
growthIntent
|
37
43
|
investors
|
38
44
|
personalTags
|
39
45
|
firmTags
|
46
|
+
customScore
|
47
|
+
industries
|
48
|
+
modifiedDate
|
49
|
+
endMarkets
|
50
|
+
productsAndServices
|
40
51
|
]
|
41
52
|
end
|
53
|
+
# rubocop:enable Metrics/MethodLength
|
42
54
|
end
|
43
55
|
end
|
44
56
|
end
|
@@ -5,9 +5,10 @@ module Sourcescrub
|
|
5
5
|
module Models
|
6
6
|
# Tag
|
7
7
|
class CompanyItems < Entity
|
8
|
-
attr_accessor :
|
8
|
+
attr_accessor :identifier, :total, :items, :type
|
9
9
|
|
10
|
-
|
10
|
+
# the identifier can be domain or SS ID
|
11
|
+
def parse_response_items(identifier, kclass_name, response)
|
11
12
|
headers = response.dig('headers')
|
12
13
|
headers&.keys&.each do |attr_name|
|
13
14
|
self.class.send(:define_method, attr_name.gsub('-', '_').to_sym) do
|
@@ -15,7 +16,7 @@ module Sourcescrub
|
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
18
|
-
dynamic_define_method(self, '
|
19
|
+
dynamic_define_method(self, 'identifier', identifier)
|
19
20
|
dynamic_define_method(self, 'type', kclass_name)
|
20
21
|
dynamic_define_method(self, 'total', response.dig(total_key) || 0)
|
21
22
|
dynamic_define_method(self, 'items', company_items(kclass_name, response.dig(items_key) || []))
|
data/lib/sourcescrub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sourcescrub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Encore Shao
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
151
|
+
rubygems_version: 3.1.6
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Sourcescrub is a ruby wrapper based on Source Scrub API.
|