sourcescrub 0.1.2 → 0.1.4

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
  SHA256:
3
- metadata.gz: 8631fba58663ed2b6340e63ac4dcbfdd387a07aa1192bb0ab911412071bf25f7
4
- data.tar.gz: 446f9ebbbbe9fe5acf1eaef967c2b10983e3f5ce9c2362799e1071af34dcf9dd
3
+ metadata.gz: cb70d2d869789d0099bc8ebdadcff34b4ac1b1481c159ac332bfa905cc337f66
4
+ data.tar.gz: ee7a9b6080c8d00b14f8cf82189195c51e8084cc4321a720b32e2dac389f13cf
5
5
  SHA512:
6
- metadata.gz: 54577a01f056d9414ffe17e72ff651e1bda42c4776ca9d820d672943a3e4f866fff933f80447feb96131932f8dadc28c132fb8a5da7149aee57bf893ee7c7d0b
7
- data.tar.gz: 726091a74644fbf1f0b09dcd5b70f8a1d5f542796ea9f756a969487362b85744165dcf823b25f2f47c8f6385c53368a582fdcf8da1f58d29fc959fe19020e249
6
+ metadata.gz: 4fa7d684dd9246ef6fec111a750b7a87640196c0051e4bdda3c6e52f1bf3734ab3c4e847cc071c471c1642507d6fb3fbadd1687b2a3e089f313649c4771800b5
7
+ data.tar.gz: 481b9c0eec9b612527f448a868da0c0445db1de9d099651ff82afe314d854a0497c7c38bd87821d61f766954ec6811aff96e3c1638d6dee282f429f004b6caaf
data/.gitignore CHANGED
@@ -11,3 +11,5 @@
11
11
 
12
12
  # rspec failure tracking
13
13
  .rspec_status
14
+
15
+ .ruby-version
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Change Log
2
2
 
3
+ ## [0.1.4] - 2026-01-09
4
+
5
+ - Add new keys to the sources API response
6
+ - listWebsite, postalCode, modifiedDate
7
+
8
+ ## [0.1.3] - 2024-06-17
9
+
10
+ - Get company data by SS ID - `client.company('XWO6N4OP')`
11
+ - Pull new fields of company
12
+ - threeMonthsGrowthRate
13
+ - sixMonthsGrowthRate
14
+ - nineMonthsGrowthRate
15
+ - twelveMonthsGrowthRate
16
+ - growthIntent
17
+ - customScore
18
+ - industries
19
+ - modifiedDate
20
+ - endMarkets
21
+ - productsAndServices
22
+
3
23
  ## [0.1.2] - 2021-01-14
4
24
 
5
25
  - Implement search source endpoint to allow use filters to get matched sources - `client.source_search({limit: 10, offset: 0})`
@@ -21,8 +41,8 @@
21
41
  ## [0.0.3] - 2020-06-20
22
42
 
23
43
  - 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'})`
44
+ - Get company data by domain - `client.company('ekohe.com')`
45
+ - Get company's relationship data by domain - `client.company('ekohe.com', {card_id: 'people'})`
26
46
  - Retrieve request limit data from header
27
47
 
28
48
  ```
data/Gemfile.lock CHANGED
@@ -1,35 +1,38 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sourcescrub (0.1.2)
4
+ sourcescrub (0.1.4)
5
5
  faraday
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.7.0)
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 (1.0.1)
18
- multipart-post (>= 1.2, < 3)
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.5)
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.4)
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(domain, args)
16
- @domain = domain
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
- @domain,
25
+ @identifier,
26
26
  @card_id
27
27
  ].compact.join('/')
28
28
  end
@@ -30,17 +30,17 @@ module Sourcescrub
30
30
  )
31
31
  end
32
32
 
33
- def company(domain, args = {})
34
- api = company_api(domain, args)
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(domain, args = {})
40
- api = company_api(domain, args.merge(model_type: company_card_mappings[args[:card_id]]))
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
- domain,
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(domain, args)
93
+ def company_api(identifier, args)
94
94
  Apis::Companies.new(
95
- domain,
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 :domain, :total, :items, :type
8
+ attr_accessor :identifier, :total, :items, :type
9
9
 
10
- def parse_response_items(domain, kclass_name, response)
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, 'domain', domain)
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) || []))
@@ -13,9 +13,11 @@ module Sourcescrub
13
13
  officialTitle
14
14
  nickname
15
15
  sourceType
16
+ listWebsite
16
17
  city
17
18
  state
18
19
  country
20
+ postalCode
19
21
  startDate
20
22
  endDate
21
23
  status
@@ -26,6 +28,7 @@ module Sourcescrub
26
28
  boothNumber
27
29
  affiliation
28
30
  rank
31
+ modifiedDate
29
32
  ]
30
33
  end
31
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sourcescrub
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.4'
5
5
  end
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.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Encore Shao
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2026-01-09 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.0.3
151
+ rubygems_version: 3.0.3.1
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: Sourcescrub is a ruby wrapper based on Source Scrub API.