linkedin_orbit 0.1.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6f4f66d8e02d0462adeb017a15fc6117c8adbec5754410dda29693920e8a3c5
4
- data.tar.gz: d810c834be558471325109f67d73aed9be83b6bc935e060b724238d1ff4acac7
3
+ metadata.gz: e5ce815b2bef824b0a24e66ed92496598fcd82a9750f246690bc2c5c780f34ab
4
+ data.tar.gz: 40fb98e7676dd2bb144c45a24d9b4d8240f4c31d9c7df7db882b7940923fc5e4
5
5
  SHA512:
6
- metadata.gz: a02b3848153540d2d31cf41aca5c220b03e9381ec4b411ac6e218c7163a28d8dc7b563f2b6f3b6806ea147004de4dcff7b444c13433382fe03bef25f13c7f005
7
- data.tar.gz: d65539d673f67bb64c03229967c9345fd8a777062555bbe87688da18d10e6550de900843d3e6d9b0d81152a8227b98fd5a33af0ddd640fe6da2ea59bed12c57b
6
+ metadata.gz: d5d583d563f04131aa565ed6bee6ee28bf515965bfb9a91fa4ee330b8a1579d33c2e8bc0c8b547552855cd8be648283cb774dab77fb75dbbb6323be94f524069
7
+ data.tar.gz: 38ea6fd791f1583224229d479f01bfc83b549b7616731e0fc22c370fd195efc6c36a17e35907aae661479de11e63a8c0422db0f75a4681b8352948816f218327
data/Gemfile.lock CHANGED
@@ -1,19 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- linkedin_orbit (0.1.2)
4
+ linkedin_orbit (0.2.0)
5
5
  dotenv (~> 2.7)
6
6
  http (~> 4.4)
7
7
  json (~> 2.5)
8
8
  linkedin (~> 1.1)
9
- orbit_activities (~> 0.1)
9
+ orbit_activities (~> 0.2)
10
10
  thor (~> 1.1)
11
11
  zeitwerk (~> 2.4)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- addressable (2.7.0)
16
+ addressable (2.8.0)
17
17
  public_suffix (>= 2.0.2, < 5.0)
18
18
  ast (2.4.2)
19
19
  byebug (11.1.3)
@@ -23,20 +23,24 @@ GEM
23
23
  domain_name (0.5.20190701)
24
24
  unf (>= 0.0.5, < 1.0.0)
25
25
  dotenv (2.7.6)
26
- faraday (1.4.2)
26
+ faraday (1.5.1)
27
27
  faraday-em_http (~> 1.0)
28
28
  faraday-em_synchrony (~> 1.0)
29
29
  faraday-excon (~> 1.1)
30
+ faraday-httpclient (~> 1.0.1)
30
31
  faraday-net_http (~> 1.0)
31
32
  faraday-net_http_persistent (~> 1.1)
33
+ faraday-patron (~> 1.0)
32
34
  multipart-post (>= 1.2, < 3)
33
35
  ruby2_keywords (>= 0.0.4)
34
36
  faraday-em_http (1.0.0)
35
37
  faraday-em_synchrony (1.0.0)
36
38
  faraday-excon (1.1.0)
39
+ faraday-httpclient (1.0.1)
37
40
  faraday-net_http (1.0.1)
38
41
  faraday-net_http_persistent (1.1.0)
39
- ffi (1.15.1)
42
+ faraday-patron (1.0.0)
43
+ ffi (1.15.3)
40
44
  ffi-compiler (1.0.1)
41
45
  ffi (>= 1.0.0)
42
46
  rake
@@ -47,7 +51,7 @@ GEM
47
51
  http-cookie (~> 1.0)
48
52
  http-form_data (~> 2.2)
49
53
  http-parser (~> 1.2.0)
50
- http-cookie (1.0.3)
54
+ http-cookie (1.0.4)
51
55
  domain_name (~> 0.5)
52
56
  http-form_data (2.3.0)
53
57
  http-parser (1.2.3)
@@ -67,18 +71,18 @@ GEM
67
71
  multi_json (~> 1.3)
68
72
  multi_xml (~> 0.5)
69
73
  rack (>= 1.2, < 3)
70
- orbit_activities (0.1.0)
74
+ orbit_activities (0.2.2)
71
75
  http (~> 4.4)
72
76
  json (~> 2.5)
73
77
  rake (~> 13.0)
74
78
  zeitwerk (~> 2.4)
75
79
  parallel (1.20.1)
76
- parser (3.0.1.1)
80
+ parser (3.0.2.0)
77
81
  ast (~> 2.4.1)
78
82
  public_suffix (4.0.6)
79
83
  rack (2.2.3)
80
84
  rainbow (3.0.0)
81
- rake (13.0.3)
85
+ rake (13.0.6)
82
86
  regexp_parser (2.1.1)
83
87
  rexml (3.2.5)
84
88
  rspec (3.10.0)
@@ -94,16 +98,16 @@ GEM
94
98
  diff-lcs (>= 1.2.0, < 2.0)
95
99
  rspec-support (~> 3.10.0)
96
100
  rspec-support (3.10.2)
97
- rubocop (1.14.0)
101
+ rubocop (1.18.3)
98
102
  parallel (~> 1.10)
99
103
  parser (>= 3.0.0.0)
100
104
  rainbow (>= 2.2.2, < 4.0)
101
105
  regexp_parser (>= 1.8, < 3.0)
102
106
  rexml
103
- rubocop-ast (>= 1.5.0, < 2.0)
107
+ rubocop-ast (>= 1.7.0, < 2.0)
104
108
  ruby-progressbar (~> 1.7)
105
109
  unicode-display_width (>= 1.4.0, < 3.0)
106
- rubocop-ast (1.5.0)
110
+ rubocop-ast (1.7.0)
107
111
  parser (>= 3.0.1.1)
108
112
  ruby-progressbar (1.11.0)
109
113
  ruby2_keywords (0.0.4)
@@ -112,7 +116,7 @@ GEM
112
116
  unf_ext
113
117
  unf_ext (0.0.7.7)
114
118
  unicode-display_width (2.0.0)
115
- webmock (3.12.0)
119
+ webmock (3.13.0)
116
120
  addressable (>= 2.3.6)
117
121
  crack (>= 0.3.2)
118
122
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -120,7 +124,6 @@ GEM
120
124
 
121
125
  PLATFORMS
122
126
  arm64-darwin-20
123
- x86_64-linux
124
127
 
125
128
  DEPENDENCIES
126
129
  byebug
data/README.md CHANGED
@@ -4,7 +4,9 @@
4
4
  [![Gem Version](https://badge.fury.io/rb/linkedin_orbit.svg)](https://badge.fury.io/rb/dev_orbit)
5
5
  [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](code_of_conduct.md)
6
6
 
7
- This is a Ruby app that can be used to integrate LinkedIn post comments into your organization's Orbit workspace.
7
+ Add your LinkedIn interactions into your Orbit workspace with this community-built integration.
8
+
9
+ ![New LinkedIn post comment in Orbit screenshot](readme_images/new-comment-screenshot.png)
8
10
 
9
11
  |<p align="left">:sparkles:</p> This is a *community project*. The Orbit team does its best to maintain it and keep it up to date with any recent API changes.<br/><br/>We welcome community contributions to make sure that it stays current. <p align="right">:sparkles:</p>|
10
12
  |-----------------------------------------|
@@ -21,7 +23,7 @@ The application requires the following environment variables:
21
23
  | Variable | Description | More Info
22
24
  |---|---|--|
23
25
  | `LINKEDIN_TOKEN` | LinkedIn Token | Follow the [First Time Setup guide](docs/FIRST_TIME_INSTRUCTIONS.md) to obtain the token
24
- | `LINKEDIN_ORGANIZATION` | LinkedIn Organization Page ID | Format: `urn:li:organization:#{id}`. ID is the set of numbers in LinkedIn page URL, i.e. `https://www.linkedin.com/company/28866695`, the ID is `28866695`.
26
+ | `LINKEDIN_ORGANIZATION` | LinkedIn Organization Page ID | Format: `urn:li:organization:#{id}`, where `id` is the set of numbers in the LinkedIn page URL, i.e. `https://www.linkedin.com/company/28866695`, the `id` is `28866695`.
25
27
  | `ORBIT_API_KEY` | API key for Orbit | Found in `Account Settings` in your Orbit workspace
26
28
  | `ORBIT_WORKSPACE_ID` | ID for your Orbit workspace | Last part of the Orbit workspace URL, i.e. `https://app.orbit.love/my-workspace`, the ID is `my-workspace`
27
29
 
@@ -54,8 +56,20 @@ client = LinkedinOrbit::Client.new(
54
56
  client = LinkedinOrbit::Client.new
55
57
  ```
56
58
 
59
+ ### Performing a Historical Import
60
+
61
+ You may want to perform a one-time historical import to fetch all your previous LinkedIn interactions and bring them into your Orbit workspace. To do so, instantiate your `client` with the `historical_import` flag:
62
+
63
+ ```ruby
64
+ client = LinkedinOrbit::Client.new(
65
+ historical_import: true
66
+ )
67
+ ```
68
+
57
69
  ### Fetching LinkedIn Comments
58
70
 
71
+ **The API token owner must be an admin on the LinkedIn organization's page in order to fetch comments. Please ask the manager of your LinkedIn page to grant admin status to your account before attempting to fetch comments.**
72
+
59
73
  Once, you have an instantiated client, you can fetch LinkedIn comments on your organization's posts and send them to Orbit by invoking the `#comments` instance method:
60
74
 
61
75
  ```ruby
@@ -68,6 +82,8 @@ You can also use this package with the included CLI. To use the CLI pass in the
68
82
  ```bash
69
83
  $ ORBIT_API_KEY=... ORBIT_WORKSPACE_ID=... LINKEDIN_TOKEN=... LINKEDIN_ORGANIZATION=... bundle exec linkedin_orbit --check_comments
70
84
  ```
85
+
86
+ **Add the `--historical-import` flag to your CLI command to perform a historical import of all your LinkedIn interactions using the CLI.**
71
87
  ## GitHub Actions Automation Setup
72
88
 
73
89
  ⚡ You can set up this integration in a matter of minutes using our GitHub Actions template. It will run regularly to add new activities to your Orbit workspace. All you need is a GitHub account.
data/bin/linkedin_orbit CHANGED
@@ -2,6 +2,7 @@
2
2
  require 'optparse'
3
3
 
4
4
  check_comments = false
5
+ historical_import = false
5
6
 
6
7
  options = {}
7
8
  choices = OptionParser.new do |opts|
@@ -13,6 +14,9 @@ choices = OptionParser.new do |opts|
13
14
  opts.on("--check-comments", "Check for new LinkedIn comments") do
14
15
  check_comments = true
15
16
  end
17
+ opts.on("--historical-import", "Performa historical import of all LinkedIn interactions") do
18
+ historical_import = true
19
+ end
16
20
  end.parse!
17
21
 
18
22
  $LOAD_PATH.unshift(File.expand_path('../lib/dev_orbit', __dir__))
@@ -23,5 +27,6 @@ require_relative '../scripts/check_comments'
23
27
  if check_comments
24
28
  puts "Checking for new LinkedIn comments and posting them to your Orbit workspace..."
25
29
  ARGV[0] = 'render'
30
+ ARGV[1] = historical_import
26
31
  LinkedinOrbit::Scripts::CheckComments.start(ARGV)
27
32
  end
@@ -1,8 +1,17 @@
1
1
  # Instructions for First Time Set Up
2
2
 
3
- These instructions will walk you through authenticating to LinkedIn, and receiving your LinkedIn token, which is needed to use this integration. You will only need to do this once every two months.
3
+ |These instructions will walk you through authenticating to LinkedIn, and receiving your LinkedIn token, which is needed to use this integration. You will only need to do this once every two months.|
4
+ |-----------------------------------------|
4
5
 
5
- ## Creating a LinkedIn Developers App
6
+ ![Setup Flow for LinkedIn](../readme_images/linkedin-flow.png)
7
+
8
+ ## 1. Before You Start
9
+
10
+ LinkedIn requires that the personal account (your LinkedIn account) requesting API access for an organization or company on LinkedIn be an admin of the organization or company's LinkedIn page.
11
+
12
+ Please verify that you have administrative privileges for the organization LinkedIn page. If you do not, your organization's administrator can grant your account the correct access level.
13
+ ## 2. LinkedIn Setup
14
+ ### Creating a LinkedIn Developers App
6
15
 
7
16
  The first thing you must do is create a LinkedIn Developers app.
8
17
 
@@ -21,7 +30,7 @@ Once you submit the form, it usually takes 3-4 days for LinkedIn to confirm the
21
30
 
22
31
  While you wait for verification, you can do the next step, which is to request the right API scope from LinkedIn.
23
32
 
24
- ## Requesting the LinkedIn Marketing Developer Platform API Access
33
+ ### Requesting the LinkedIn Marketing Developer Platform API Access
25
34
 
26
35
  LinkedIn has many different types of APIs and many different types of access levels to those APIs. The API your app needs access to is the **Marketing Developer Platform**.
27
36
 
@@ -33,7 +42,17 @@ This will take another few days for LinkedIn to verify and confirm this request.
33
42
 
34
43
  ![LinkedIn Developer Products List](../readme_images/products_list.png)
35
44
 
36
- ## LinkedIn API Credentials
45
+ ## 3. Wait for LinkedIn
46
+
47
+ At this point, you need to wait for LinkedIn to approve both your new developer application, and access to the Marketing Developer Platform API. This generally takes several days. LinkedIn will both email you with an update, and post an update inside the [LinkedIn Developers](https://www.linkedin.com/developers) page.
48
+
49
+ If your request is denied access, you can submit an appeal to LinkedIn. The appeal process can take several days again. Pay close attention to the specified reason LinkedIn provided for the initial rejection, and work to remedy it before submitting an appeal.
50
+
51
+ The Orbit Developer Relations team unfortunately cannot assist or address LinkedIn API approval processes.
52
+
53
+ ## 4. Integration Setup
54
+
55
+ ### LinkedIn API Credentials
37
56
 
38
57
  You will need your LinkedIn API credentials to move forward. You can copy your LinkedIn credentials, which are your Client ID and Client Secret from the "Auth" section in the LinkedIn Developers dashboard.
39
58
 
@@ -45,7 +64,9 @@ You will also see on the "Auth" page a section called "OAuth 2.0 Settings". We w
45
64
 
46
65
  After you have finished all of the above steps, you are ready to move on to the last step in this first time setup instructions.
47
66
 
48
- ## LinkedIn Token
67
+ ### LinkedIn Token
68
+
69
+ **Do not proceed to this step until you have received approval from LinkedIn for your API access request. This next step will not work until that has happened.**
49
70
 
50
71
  LinkedIn uses OAuth 2.0 as its authentication format, and as such, you need to authenticate *one time every two months* to obtain a token that will be used for the integration from then on.
51
72
 
@@ -73,14 +94,14 @@ Now, return back to your browser window with your Heroku app running. Click on t
73
94
 
74
95
  The last step you need to complete in this first time setup is to add the LinkedIn token you created into the LinkedIn Orbit community integration credentials, either in the context of a standalone app or in the context of running it as a GitHub Action.
75
96
 
76
- ## Add the LinkedIn Token to the LinkedIn Orbit Community Integration
77
- ### Within GitHub Actions
97
+ ### Add the LinkedIn Token to the LinkedIn Orbit Community Integration
98
+ #### Within GitHub Actions
78
99
 
79
100
  *(This step assumes you have a GitHub repository created already to run the LinkedIn Orbit community integration. If you do not, please follow [this guide](https://docs.github.com/en/github/getting-started-with-github/create-a-repo) first.)*
80
101
 
81
102
  The LinkedIn token you created in the last step needs to be added to the GitHub repository that you are running the LinkedIn Orbit community integration from. To do so, follow the step-by-step guide in the [README](https://github.com/orbit-love/github-actions-templates/blob/main/README.md#adding-your-credentials-to-github) in the GitHub Actions instructions. The name for this secret **must** be: `LINKEDIN_TOKEN`.
82
103
 
83
- ### Within a Standalone App
104
+ #### Within a Standalone App
84
105
 
85
106
  If you are running the community integration as a standalone app, you can add the LinkedIn token as an environment variable inside the `.env` file in the root directory of the codebase.
86
107
 
@@ -89,6 +110,6 @@ Open up the `.env` file and add a new line starting with `LINKEDIN_TOKEN=` and a
89
110
 
90
111
  You have now successfully finished the setup for your LinkedIn Orbit community integration. This steps needs to occur once every 60 days.
91
112
 
92
- In between, you can safely delete the Heroku app you created and recreate a new one when you need to do this again.
113
+ In between, you should delete the Heroku app you created and recreate a new one when you need to do this again as keeping it alive potentially exposes your LinkedIn token to those who may come across it.
93
114
 
94
115
  From within the Heroku dashboard, navigate to the "Settings" for the app and at the very bottom of the page is a button called "Delete app". Once you click on that button, Heroku will confirm you wish to delete the app. Upon confirmation, the app will be deleted and the deployment on the web will be removed.
@@ -29,13 +29,18 @@ require "json"
29
29
  # The LinkedIn organization would use the last component of that web address and would be:
30
30
  # urn:li:organization:28866695
31
31
  #
32
+ # @option params [Boolean] :historical_import
33
+ # Whether to do an import of all LinkedIn interactions ignoring latest
34
+ # activity already in the Orbit workspace.
35
+ # Default is false.
36
+ #
32
37
  # @param [Hash] params
33
38
  #
34
39
  # @return [DevOrbit::Client]
35
40
  #
36
41
  module LinkedinOrbit
37
42
  class Client
38
- attr_accessor :orbit_api_key, :orbit_workspace, :linkedin_organization
43
+ attr_accessor :orbit_api_key, :orbit_workspace, :linkedin_organization, :historical_import
39
44
  attr_reader :linkedin_token
40
45
 
41
46
  def initialize(params = {})
@@ -43,6 +48,7 @@ module LinkedinOrbit
43
48
  @orbit_workspace = params.fetch(:orbit_workspace, ENV["ORBIT_WORKSPACE_ID"])
44
49
  @linkedin_token = token
45
50
  @linkedin_organization = params.fetch(:linkedin_organization, ENV["LINKEDIN_ORGANIZATION"])
51
+ @historical_import = params.fetch(:historical_import, false)
46
52
  end
47
53
 
48
54
  def token
@@ -54,7 +60,8 @@ module LinkedinOrbit
54
60
  linkedin_token: @linkedin_token,
55
61
  linkedin_organization: @linkedin_organization,
56
62
  orbit_api_key: @orbit_api_key,
57
- orbit_workspace: @orbit_workspace
63
+ orbit_workspace: @orbit_workspace,
64
+ historical_import: @historical_import
58
65
  ).process_comments
59
66
  end
60
67
  end
@@ -34,6 +34,7 @@ module LinkedinOrbit
34
34
  occurred_at: Time.at(@comment["created"]["time"] / 1000).utc,
35
35
  key: @comment["id"],
36
36
  link: "https://www.linkedin.com/feed/update/#{@comment["object"]}",
37
+ link_text: "View on LinkedIn",
37
38
  member: {
38
39
  name: name
39
40
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
-
2
+ require "byebug"
3
3
  module LinkedinOrbit
4
4
  class Linkedin
5
5
  def initialize(params = {})
@@ -7,19 +7,49 @@ module LinkedinOrbit
7
7
  @linkedin_token = params.fetch(:linkedin_token)
8
8
  @orbit_api_key = params.fetch(:orbit_api_key)
9
9
  @orbit_workspace = params.fetch(:orbit_workspace)
10
+ @historical_import = params.fetch(:historical_import, false)
10
11
  end
11
12
 
12
13
  def process_comments
13
14
  posts = get_posts
14
15
 
16
+ return posts unless posts.is_a?(Array)
17
+
18
+ orbit_timestamp = last_orbit_activity_timestamp
19
+
20
+ times = 0
15
21
  posts.each do |post|
22
+
16
23
  comments = get_post_comments(post["id"])
17
24
 
18
- comments.reject! { |comment| comment["actor~"]["id"] == "private" }
19
-
20
25
  next if comments.nil? || comments.empty?
21
26
 
27
+ # Indicates that the member does not want their information shared
28
+ # Member viewing access if forbidden for profile memberId
29
+ comments.reject! do |comment|
30
+ if comment.has_key? "actor!"
31
+ true if comment["actor!"]["status"] == 403
32
+ end
33
+ end
34
+
35
+ # Indicates that the member does not want their information shared
36
+ comments.reject! do |comment|
37
+ if comment.has_key? "actor~"
38
+ true if comment["actor~"]["id"] == "private"
39
+ end
40
+ end
41
+
22
42
  comments.each do |comment|
43
+ unless @historical_import && orbit_timestamp
44
+ next if Time.at(comment["created"]["time"] / 1000).utc.to_s < orbit_timestamp unless orbit_timestamp.nil?
45
+ end
46
+
47
+ if orbit_timestamp && @historical_import == false
48
+ next if Time.at(comment["created"]["time"] / 1000).utc.to_s < orbit_timestamp
49
+ end
50
+
51
+ times += 1
52
+
23
53
  LinkedinOrbit::Orbit.call(
24
54
  type: "comments",
25
55
  data: {
@@ -31,28 +61,53 @@ module LinkedinOrbit
31
61
  )
32
62
  end
33
63
  end
64
+
65
+ output = "Sent #{times} new comments to your Orbit workspace"
66
+
67
+ puts output
68
+ return output
34
69
  end
35
70
 
36
71
  def get_posts
37
72
  posts = []
38
- url = URI("https://api.linkedin.com/v2/shares?q=owners&owners=#{@linkedin_organization}")
39
- https = Net::HTTP.new(url.host, url.port)
40
- https.use_ssl = true
73
+ page = 0
74
+ count = 100
75
+ total = 0
41
76
 
42
- request = Net::HTTP::Get.new(url)
43
- request["Accept"] = "application/json"
44
- request["Content-Type"] = "application/json"
45
- request["Authorization"] = "Bearer #{@linkedin_token}"
77
+ while page * count <= total
78
+ url = URI("https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(#{CGI.escape(@linkedin_organization)})&sortBy=LAST_MODIFIED&start=#{page*count}&count=#{count}")
79
+ https = Net::HTTP.new(url.host, url.port)
80
+ https.use_ssl = true
46
81
 
47
- response = https.request(request)
82
+ request = Net::HTTP::Get.new(url)
83
+ request["Accept"] = "application/json"
84
+ request["X-Restli-Protocol-Version"] = "2.0.0"
85
+ request["Content-Type"] = "application/json"
86
+ request["Authorization"] = "Bearer #{@linkedin_token}"
48
87
 
49
- response = JSON.parse(response.body)
50
-
51
- response["elements"].each do |element|
52
- posts << {
53
- "id" => element["activity"],
54
- "message_highlight" => element["text"]["text"][0, 40]
55
- }
88
+ response = https.request(request)
89
+
90
+ response = JSON.parse(response.body)
91
+
92
+ total = response["paging"]["total"] if page == 0
93
+
94
+ return response["message"] if response["serviceErrorCode"]
95
+
96
+ if response["elements"].nil? || response["elements"].empty?
97
+ return <<~HEREDOC
98
+ No new posts to process from your LinkedIn organization.
99
+ If you suspect this is incorrect, verify your LinkedIn organization schema is correct in your credentials.
100
+ HEREDOC
101
+ end
102
+
103
+ response["elements"].each do |element|
104
+ next if element["id"].nil?
105
+ posts << {
106
+ "id" => element["id"],
107
+ "message_highlight" => element["specificContent"]["com.linkedin.ugc.ShareContent"]["shareCommentary"]["text"][0, 40]
108
+ }
109
+ end
110
+ page += 1
56
111
  end
57
112
 
58
113
  posts
@@ -74,5 +129,17 @@ module LinkedinOrbit
74
129
 
75
130
  response["elements"]
76
131
  end
132
+
133
+ def last_orbit_activity_timestamp
134
+ @last_orbit_activity_timestamp ||= begin
135
+ OrbitActivities::Request.new(
136
+ api_key: @orbit_api_key,
137
+ workspace_id: @orbit_workspace,
138
+ user_agent: "community-ruby-linkedin-orbit/#{LinkedinOrbit::VERSION}",
139
+ action: "latest_activity_timestamp",
140
+ filters: { activity_type: "custom:linkedin:comment" }
141
+ ).response
142
+ end
143
+ end
77
144
  end
78
145
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LinkedinOrbit
4
- VERSION = "0.1.3"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -5,7 +5,7 @@ require_relative "lib/linkedin_orbit/version"
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "linkedin_orbit"
7
7
  spec.version = LinkedinOrbit::VERSION
8
- spec.authors = ["Orbit DevRel", "Ben Greenberg"]
8
+ spec.authors = ["Orbit DevRel", "Ben Greenberg", "Colin Loretz"]
9
9
  spec.email = ["devrel@orbit.love"]
10
10
 
11
11
  spec.summary = "Integrate LinkedIn interactions into Orbit"
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency "thor", "~> 1.1"
33
33
  spec.add_dependency "linkedin", "~> 1.1"
34
34
  spec.add_dependency "dotenv", "~> 2.7"
35
- spec.add_dependency "orbit_activities", "~> 0.1"
35
+ spec.add_dependency "orbit_activities", "~> 0.2"
36
36
  spec.add_development_dependency "rspec", "~> 3.4"
37
37
  spec.add_development_dependency "webmock", "~> 3.12"
38
38
  end
Binary file
Binary file
@@ -8,8 +8,8 @@ module LinkedinOrbit
8
8
  module Scripts
9
9
  class CheckComments < Thor
10
10
  desc "render", "check for new LinkedIn post comments and push them to Orbit"
11
- def render
12
- client = LinkedinOrbit::Client.new
11
+ def render(*params)
12
+ client = LinkedinOrbit::Client.new(historical_import: params[0])
13
13
  client.comments
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linkedin_orbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orbit DevRel
8
8
  - Ben Greenberg
9
- autorequire:
9
+ - Colin Loretz
10
+ autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2021-05-24 00:00:00.000000000 Z
13
+ date: 2021-12-21 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: http
@@ -101,14 +102,14 @@ dependencies:
101
102
  requirements:
102
103
  - - "~>"
103
104
  - !ruby/object:Gem::Version
104
- version: '0.1'
105
+ version: '0.2'
105
106
  type: :runtime
106
107
  prerelease: false
107
108
  version_requirements: !ruby/object:Gem::Requirement
108
109
  requirements:
109
110
  - - "~>"
110
111
  - !ruby/object:Gem::Version
111
- version: '0.1'
112
+ version: '0.2'
112
113
  - !ruby/object:Gem::Dependency
113
114
  name: rspec
114
115
  requirement: !ruby/object:Gem::Requirement
@@ -168,9 +169,11 @@ files:
168
169
  - readme_images/client_credentials.png
169
170
  - readme_images/create_app_button.png
170
171
  - readme_images/heroku_view_app_button.png
172
+ - readme_images/linkedin-flow.png
171
173
  - readme_images/linkedin_oauth_redirects.png
172
174
  - readme_images/logo.png
173
175
  - readme_images/marketing_platform_request_access.png
176
+ - readme_images/new-comment-screenshot.png
174
177
  - readme_images/products_list.png
175
178
  - readme_images/ways-to-use.png
176
179
  - scripts/check_comments.rb
@@ -181,7 +184,7 @@ metadata:
181
184
  homepage_uri: https://github.com/orbit-love/community-ruby-linkedin-orbit
182
185
  source_code_uri: https://github.com/orbit-love/community-ruby-linkedin-orbit
183
186
  changelog_uri: https://github.com/orbit-love/community-ruby-linkedin-orbit/blob/main/CHANGELOG.md
184
- post_install_message:
187
+ post_install_message:
185
188
  rdoc_options: []
186
189
  require_paths:
187
190
  - lib
@@ -196,8 +199,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
199
  - !ruby/object:Gem::Version
197
200
  version: '0'
198
201
  requirements: []
199
- rubygems_version: 3.2.15
200
- signing_key:
202
+ rubygems_version: 3.1.4
203
+ signing_key:
201
204
  specification_version: 4
202
205
  summary: Integrate LinkedIn interactions into Orbit
203
206
  test_files: []