dev_orbit 0.2.0 → 0.5.1

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: 051a39f2fff550c076f0a7bec373c7634f0b6516a9173121ba4b9facebfa157c
4
- data.tar.gz: acad969ccbc5ac6dd29b176f069e4a94eb00cec1ffa69c301a9c5da5284e3d6a
3
+ metadata.gz: 49d580cf75ef85e8e082e763b2c48232431ce5f945edb6f28050a16d98f717b8
4
+ data.tar.gz: 65f47c79b4f40649c9e36a7a4186c854340d335e503d503927a81cb06027c1d2
5
5
  SHA512:
6
- metadata.gz: 6953c67373ff7f8ae654a87916045b54c2254736809fd074ff26f6a46b400a9e6144226eaf29d2247e3e532877735b378adc77e28b29532e3d4325cf5b22ebce
7
- data.tar.gz: e1a4069e95e2b5ff86b14625132bef5e5342c55e1e2d4cd767345fbd53e114cbb5ed5515826e554ffbeb04d929f1bdab1322b93868504a651a0a2ac0afef5cac
6
+ metadata.gz: bda03fdecb838c3b11f217a7a5da316cb05a64942aaadad0b6bf17d82aae00792af8ceed8250c259e7b3de2933836e338c9a6730eb584a897544ff7061cae5b5
7
+ data.tar.gz: 4caf442b3598ec3727604049825d6cfc90f8a47bbdc5b0942a2693b82e8a8d6eb1550f6dd4c48a5ddfd805dc4849fbead1213923229e5356d3421430c0847e7a
data/CHANGELOG.md CHANGED
@@ -41,4 +41,14 @@
41
41
  ## [0.1.0] - 2021-05-06
42
42
 
43
43
  - Correct CLI `CheckFollowers` action
44
- - Update gem specifications
44
+ - Update gem specifications
45
+ ## [0.4.1] - 2021-07-01
46
+
47
+ - Remove debugging output from processing DEV comments
48
+ ## [0.5.0] - 2021-07-08
49
+
50
+ - Add pagination for all DEV interactions
51
+ - Dynamically filter what to send to Orbit based on last item of that type in the Orbit workspace
52
+ ## [0.5.1] - 2021-07-11
53
+
54
+ - Fix URL query params path for organization comments
data/Gemfile.lock CHANGED
@@ -1,36 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dev_orbit (0.1.3)
4
+ dev_orbit (0.5.1)
5
5
  actionview (~> 6.1)
6
6
  activesupport (~> 6.1)
7
7
  http (~> 4.4)
8
8
  json (~> 2.5)
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
- actionview (6.1.3.2)
17
- activesupport (= 6.1.3.2)
16
+ actionview (6.1.4)
17
+ activesupport (= 6.1.4)
18
18
  builder (~> 3.1)
19
19
  erubi (~> 1.4)
20
20
  rails-dom-testing (~> 2.0)
21
21
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
22
- activesupport (6.1.3.2)
22
+ activesupport (6.1.4)
23
23
  concurrent-ruby (~> 1.0, >= 1.0.2)
24
24
  i18n (>= 1.6, < 2)
25
25
  minitest (>= 5.1)
26
26
  tzinfo (~> 2.0)
27
27
  zeitwerk (~> 2.3)
28
- addressable (2.7.0)
28
+ addressable (2.8.0)
29
29
  public_suffix (>= 2.0.2, < 5.0)
30
30
  ast (2.4.2)
31
31
  builder (3.2.4)
32
32
  byebug (11.1.3)
33
- concurrent-ruby (1.1.8)
33
+ concurrent-ruby (1.1.9)
34
34
  crack (0.4.5)
35
35
  rexml
36
36
  crass (1.0.6)
@@ -38,7 +38,7 @@ GEM
38
38
  domain_name (0.5.20190701)
39
39
  unf (>= 0.0.5, < 1.0.0)
40
40
  erubi (1.10.0)
41
- ffi (1.15.0)
41
+ ffi (1.15.3)
42
42
  ffi-compiler (1.0.1)
43
43
  ffi (>= 1.0.0)
44
44
  rake
@@ -48,7 +48,7 @@ GEM
48
48
  http-cookie (~> 1.0)
49
49
  http-form_data (~> 2.2)
50
50
  http-parser (~> 1.2.0)
51
- http-cookie (1.0.3)
51
+ http-cookie (1.0.4)
52
52
  domain_name (~> 0.5)
53
53
  http-form_data (2.3.0)
54
54
  http-parser (1.2.3)
@@ -56,27 +56,19 @@ GEM
56
56
  i18n (1.8.10)
57
57
  concurrent-ruby (~> 1.0)
58
58
  json (2.5.1)
59
- loofah (2.9.1)
59
+ loofah (2.10.0)
60
60
  crass (~> 1.0.2)
61
61
  nokogiri (>= 1.5.9)
62
62
  minitest (5.14.4)
63
- nokogiri (1.11.5-arm64-darwin)
63
+ nokogiri (1.11.7-arm64-darwin)
64
64
  racc (~> 1.4)
65
- nokogiri (1.11.5-x86_64-darwin)
66
- racc (~> 1.4)
67
- nokogiri (1.11.5-x86_64-linux)
68
- racc (~> 1.4)
69
- nokogiri (1.11.3-x86_64-darwin)
70
- racc (~> 1.4)
71
- nokogiri (1.11.3-x86_64-linux)
72
- racc (~> 1.4)
73
- orbit_activities (0.1.0)
65
+ orbit_activities (0.2.2)
74
66
  http (~> 4.4)
75
67
  json (~> 2.5)
76
68
  rake (~> 13.0)
77
69
  zeitwerk (~> 2.4)
78
70
  parallel (1.20.1)
79
- parser (3.0.0.0)
71
+ parser (3.0.2.0)
80
72
  ast (~> 2.4.1)
81
73
  public_suffix (4.0.6)
82
74
  racc (1.5.2)
@@ -86,7 +78,7 @@ GEM
86
78
  rails-html-sanitizer (1.3.0)
87
79
  loofah (~> 2.3)
88
80
  rainbow (3.0.0)
89
- rake (13.0.3)
81
+ rake (13.0.6)
90
82
  regexp_parser (2.1.1)
91
83
  rexml (3.2.5)
92
84
  rspec (3.10.0)
@@ -102,17 +94,17 @@ GEM
102
94
  diff-lcs (>= 1.2.0, < 2.0)
103
95
  rspec-support (~> 3.10.0)
104
96
  rspec-support (3.10.2)
105
- rubocop (1.11.0)
97
+ rubocop (1.18.3)
106
98
  parallel (~> 1.10)
107
99
  parser (>= 3.0.0.0)
108
100
  rainbow (>= 2.2.2, < 4.0)
109
101
  regexp_parser (>= 1.8, < 3.0)
110
102
  rexml
111
- rubocop-ast (>= 1.2.0, < 2.0)
103
+ rubocop-ast (>= 1.7.0, < 2.0)
112
104
  ruby-progressbar (~> 1.7)
113
105
  unicode-display_width (>= 1.4.0, < 3.0)
114
- rubocop-ast (1.4.1)
115
- parser (>= 2.7.1.5)
106
+ rubocop-ast (1.7.0)
107
+ parser (>= 3.0.1.1)
116
108
  ruby-progressbar (1.11.0)
117
109
  thor (1.1.0)
118
110
  tzinfo (2.0.4)
@@ -121,7 +113,7 @@ GEM
121
113
  unf_ext
122
114
  unf_ext (0.0.7.7)
123
115
  unicode-display_width (2.0.0)
124
- webmock (3.12.1)
116
+ webmock (3.13.0)
125
117
  addressable (>= 2.3.6)
126
118
  crack (>= 0.3.2)
127
119
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -129,8 +121,6 @@ GEM
129
121
 
130
122
  PLATFORMS
131
123
  arm64-darwin-20
132
- x86_64-darwin-19
133
- x86_64-linux
134
124
 
135
125
  DEPENDENCIES
136
126
  byebug
data/README.md CHANGED
@@ -54,6 +54,15 @@ client = DevOrbit::Client.new(
54
54
  )
55
55
  ```
56
56
 
57
+ ### Performing a Historical Import
58
+
59
+ By default, the integration will only import comments that are newer than the newest DEV comment in your Orbit workspace. You may want to perform a one-time historical import to fetch all your previous DEV comments and bring them into your Orbit workspace. To do so, instantiate your `client` with the `historical_import` flag:
60
+
61
+ ```ruby
62
+ client = DevOrbit::Client.new(
63
+ historical_import: true
64
+ )
65
+ ```
57
66
  ### Post New DEV Comments from a DEV User to Orbit Workspace
58
67
 
59
68
  You can use the gem to get new DEV comments on your DEV user by invoking the `#comments` method on your `client` instance:
@@ -74,7 +83,6 @@ client.organization_comments
74
83
 
75
84
  This method will fetch all your organization articles from DEV, gather their respective comments, filter them for anything within the past day, and then send them to your Orbit workspace via the Orbit API.
76
85
 
77
-
78
86
  ### Post New DEV Followers to Orbit Workspace
79
87
 
80
88
  You can use the gem to get new DEV followers by invoking the `#followers` method on your `client` instance:
@@ -106,6 +114,7 @@ $ ORBIT_API_KEY='...' ORBIT_WORKSPACE='...' DEV_API_KEY='...' DEV_USERNAME='...'
106
114
  ```bash
107
115
  $ ORBIT_API_KEY='...' ORBIT_WORKSPACE='...' DEV_API_KEY='...' DEV_ORGANIZATION='...' bundle exec dev_orbit --check-organization-comments
108
116
  ```
117
+ **Add the `--historical-import` flag to your CLI command to perform a historical import of all your DEV comments using the CLI.**
109
118
 
110
119
  ## Contributing
111
120
 
data/bin/dev_orbit CHANGED
@@ -4,6 +4,7 @@ require 'optparse'
4
4
  check_comments = false
5
5
  check_followers = false
6
6
  check_org_comments = false
7
+ historical_import = false
7
8
 
8
9
  options = {}
9
10
  choices = OptionParser.new do |opts|
@@ -21,6 +22,9 @@ choices = OptionParser.new do |opts|
21
22
  opts.on("--check-organization-comments", "Check for new DEV comments for an organization") do
22
23
  check_org_comments = true
23
24
  end
25
+ opts.on("--historical-import", "Performa historical import of all new DEV comments") do
26
+ historical_import = true
27
+ end
24
28
  end.parse!
25
29
 
26
30
  $LOAD_PATH.unshift(File.expand_path('../lib/dev_orbit', __dir__))
@@ -33,6 +37,7 @@ require_relative '../scripts/check_org_comments'
33
37
  if check_comments
34
38
  puts "Checking for new DEV comments within the past day and posting them to your Orbit workspace..."
35
39
  ARGV[0] = 'render'
40
+ ARGV[1] = historical_import
36
41
  DevOrbit::Scripts::CheckComments.start(ARGV)
37
42
  end
38
43
 
@@ -45,5 +50,6 @@ end
45
50
  if check_org_comments
46
51
  puts "Checking for new DEV organization comments and posting them to your Orbit workspace..."
47
52
  ARGV[0] = 'render'
53
+ ARGV[1] = historical_import
48
54
  DevOrbit::Scripts::CheckOrgComments.start(ARGV)
49
55
  end
data/dev_orbit.gemspec CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.add_dependency "json", "~> 2.5"
36
36
  spec.add_dependency "zeitwerk", "~> 2.4"
37
37
  spec.add_dependency "thor", "~> 1.1"
38
- spec.add_dependency "orbit_activities", "~> 0.1"
38
+ spec.add_dependency "orbit_activities", "~> 0.2"
39
39
  spec.add_development_dependency "rspec", "~> 3.4"
40
40
  spec.add_development_dependency "webmock", "~> 3.12"
41
41
 
@@ -22,13 +22,17 @@
22
22
  # @option params [String] :orbit_api_key
23
23
  # The API key for the Orbit API
24
24
  #
25
+ # @option params [Boolean] :historical_import
26
+ # Perform a historical import on all DEV comments
27
+ # Boolean, default to false
28
+ #
25
29
  # @param [Hash] params
26
30
  #
27
31
  # @return [DevOrbit::Client]
28
32
  #
29
33
  module DevOrbit
30
34
  class Client
31
- attr_accessor :dev_username, :dev_api_key, :dev_organization, :orbit_workspace, :orbit_api_key
35
+ attr_accessor :dev_username, :dev_api_key, :dev_organization, :orbit_workspace, :orbit_api_key, :historical_import
32
36
 
33
37
  def initialize(params = {})
34
38
  @orbit_api_key = params.fetch(:orbit_api_key, ENV["ORBIT_API_KEY"])
@@ -36,6 +40,7 @@ module DevOrbit
36
40
  @dev_api_key = params.fetch(:dev_api_key, ENV["DEV_API_KEY"])
37
41
  @dev_username = params.fetch(:dev_username, ENV["DEV_USERNAME"])
38
42
  @dev_organization = params.fetch(:dev_organization, ENV["DEV_ORGANIZATION"])
43
+ @historical_import = params.fetch(:historical_import, false)
39
44
  end
40
45
 
41
46
  # Fetch new comments from DEV and post them to the Orbit workspace
@@ -44,7 +49,8 @@ module DevOrbit
44
49
  api_key: @dev_api_key,
45
50
  username: @dev_username,
46
51
  workspace_id: @orbit_workspace,
47
- orbit_api_key: @orbit_api_key
52
+ orbit_api_key: @orbit_api_key,
53
+ historical_import: @historical_import
48
54
  ).process_comments(type: type)
49
55
  end
50
56
 
data/lib/dev_orbit/dev.rb CHANGED
@@ -13,17 +13,20 @@ module DevOrbit
13
13
  @api_key = params.fetch(:api_key, ENV["DEV_API_KEY"])
14
14
  @workspace_id = params.fetch(:workspace_id, ENV["ORBIT_WORKSPACE_ID"])
15
15
  @orbit_api_key = params.fetch(:orbit_api_key, ENV["ORBIT_API_KEY"])
16
+ @historical_import = params.fetch(:historical_import, false)
16
17
  end
17
18
 
18
19
  def process_comments(type:)
19
20
  articles = get_articles(type: type)
20
21
 
22
+ return if articles.empty? || articles.nil?
23
+
21
24
  articles.each do |article|
22
25
  comments = get_article_comments(article["id"])
23
26
 
24
27
  next if comments.nil? || comments.empty?
25
28
 
26
- DevOrbit::Orbit.call(
29
+ return DevOrbit::Orbit.new(
27
30
  type: "comments",
28
31
  data: {
29
32
  comments: comments,
@@ -31,60 +34,91 @@ module DevOrbit
31
34
  url: article["url"]
32
35
  },
33
36
  workspace_id: @workspace_id,
34
- api_key: @orbit_api_key
35
- )
37
+ api_key: @orbit_api_key,
38
+ historical_import: @historical_import
39
+ ).call
36
40
  end
37
41
  end
38
42
 
39
43
  def process_followers
40
44
  followers = get_followers
41
45
 
42
- followers.each do |follower|
43
- next if follower.nil? || follower.empty?
44
-
45
- DevOrbit::Orbit.call(
46
- type: "followers",
47
- data: {
48
- follower: follower
49
- },
50
- workspace_id: @workspace_id,
51
- api_key: @orbit_api_key
52
- )
53
- end
46
+ return if followers.empty? || followers.nil?
47
+
48
+ DevOrbit::Orbit.new(
49
+ type: "followers",
50
+ data: {
51
+ followers: followers
52
+ },
53
+ workspace_id: @workspace_id,
54
+ api_key: @orbit_api_key,
55
+ historical_import: @historical_import,
56
+ last_orbit_member_timestamp: last_orbit_member_timestamp
57
+ ).call
54
58
  end
55
59
 
56
60
  private
57
61
 
58
62
  def get_articles(type:)
59
- if type == "user"
60
- url = URI("https://dev.to/api/articles?username=#{@username}&top=1")
61
- end
63
+ page = 1
64
+ articles = []
65
+ looped_at_least_once = false
62
66
 
63
- if type == "organization"
64
- url = URI("https://dev.to/api/organizations/#{@organization}/articles")
65
- end
67
+ while page >= 1
68
+ page += 1 if looped_at_least_once
69
+ url = URI("https://dev.to/api/articles?username=#{@username}&page=#{page}&per_page=1000") if type == "user"
66
70
 
67
- https = Net::HTTP.new(url.host, url.port)
68
- https.use_ssl = true
71
+ if type == "organization"
72
+ url = URI("https://dev.to/api/organizations/#{@organization}/articles?page=#{page}&per_page=1000")
73
+ end
69
74
 
70
- request = Net::HTTP::Get.new(url)
75
+ https = Net::HTTP.new(url.host, url.port)
76
+ https.use_ssl = true
71
77
 
72
- response = https.request(request)
78
+ request = Net::HTTP::Get.new(url)
79
+
80
+ response = https.request(request)
73
81
 
74
- JSON.parse(response.body) if DevOrbit::Utils.valid_json?(response.body)
82
+ break if response.code == "404"
83
+
84
+ response = JSON.parse(response.body) if DevOrbit::Utils.valid_json?(response.body)
85
+
86
+ articles << response unless response.empty? || response.nil?
87
+ looped_at_least_once = true
88
+
89
+ break if response.empty? || response.nil?
90
+ end
91
+
92
+ articles.flatten!
75
93
  end
76
94
 
77
95
  def get_followers
78
- url = URI("https://dev.to/api/followers/users")
79
- https = Net::HTTP.new(url.host, url.port)
80
- https.use_ssl = true
96
+ page = 1
97
+ followers = []
98
+ looped_at_least_once = false
81
99
 
82
- request = Net::HTTP::Get.new(url)
83
- request["api_key"] = @api_key
100
+ while page >= 1
101
+ page += 1 if looped_at_least_once
102
+ url = URI("https://dev.to/api/followers/users?page=#{page}&per_page=1000")
103
+ https = Net::HTTP.new(url.host, url.port)
104
+ https.use_ssl = true
84
105
 
85
- response = https.request(request)
106
+ request = Net::HTTP::Get.new(url)
107
+ request["api_key"] = @api_key
108
+
109
+ response = https.request(request)
110
+
111
+ break if response.code == "404"
112
+
113
+ response = JSON.parse(response.body) if DevOrbit::Utils.valid_json?(response.body)
86
114
 
87
- JSON.parse(response.body) if DevOrbit::Utils.valid_json?(response.body)
115
+ followers << response unless response.empty? || response.nil?
116
+ looped_at_least_once = true
117
+
118
+ break if response.empty? || response.nil?
119
+ end
120
+
121
+ followers.flatten!
88
122
  end
89
123
 
90
124
  def get_article_comments(id)
@@ -100,12 +134,27 @@ module DevOrbit
100
134
 
101
135
  return if comments.nil? || comments.empty?
102
136
 
103
- filter_comments(comments)
137
+ comments
104
138
  end
105
139
 
106
- def filter_comments(comments)
107
- comments.select do |comment|
108
- comment["created_at"] <= 1.day.ago
140
+ def last_orbit_member_timestamp
141
+ @last_orbit_member_timestamp ||= begin
142
+ url = URI("https://app.orbit.love/api/v1/#{@workspace_id}/members?direction=DESC&items=10&identity=devto&sort=created_at")
143
+
144
+ http = Net::HTTP.new(url.host, url.port)
145
+ http.use_ssl = true
146
+
147
+ request = Net::HTTP::Get.new(url)
148
+ request["Accept"] = "application/json"
149
+ request["Authorization"] = "Bearer #{@orbit_api_key}"
150
+ request["User-Agent"] = "community-ruby-dev-orbit/#{DevOrbit::VERSION}"
151
+
152
+ response = http.request(request)
153
+ response = JSON.parse(response.body)
154
+
155
+ return nil if response["data"].nil? || response["data"].empty?
156
+
157
+ response["data"][0]["attributes"]["created_at"]
109
158
  end
110
159
  end
111
160
  end
@@ -43,8 +43,7 @@ module DevOrbit
43
43
  {
44
44
  member: {
45
45
  name: @name.include?("_") ? @name.split("_").map(&:capitalize).join(" ") : @name,
46
- devto: @username,
47
- url: "https://dev.to#{@url}"
46
+ devto: @username
48
47
  }
49
48
  }
50
49
  end
@@ -2,31 +2,101 @@
2
2
 
3
3
  require "net/http"
4
4
  require "json"
5
+ require "active_support/time"
5
6
 
6
7
  module DevOrbit
7
8
  class Orbit
8
- def self.call(type:, data:, workspace_id:, api_key:)
9
- if type == "comments"
10
- data[:comments].each do |comment|
9
+ def initialize(type:, data:, workspace_id:, api_key:, historical_import: false, last_orbit_member_timestamp: nil)
10
+ @type = type
11
+ @data = data
12
+ @workspace_id = workspace_id
13
+ @api_key = api_key
14
+ @historical_import = historical_import
15
+ @last_orbit_activity_timestamp = last_orbit_activity_timestamp(type)
16
+ @last_orbit_member_timestamp = last_orbit_member_timestamp
17
+ end
18
+
19
+ def call
20
+ if @type == "comments"
21
+ times = 0
22
+
23
+ @data[:comments].each do |comment|
24
+ unless @historical_import && @last_orbit_activity_timestamp
25
+ next if (comment["created_at"] || comment[:created_at]) < @last_orbit_activity_timestamp unless @last_orbit_activity_timestamp.nil?
26
+ end
27
+
28
+ if @last_orbit_activity_timestamp && @historical_import == false
29
+ next if (comment["created_at"] || comment[:created_at]) < @last_orbit_activity_timestamp
30
+ end
31
+
32
+ times += 1
33
+
11
34
  DevOrbit::Interactions::Comment.new(
12
- article_title: data.transform_keys(&:to_sym)[:title],
35
+ article_title: @data.transform_keys(&:to_sym)[:title],
13
36
  comment: comment.transform_keys(&:to_sym),
14
- url: data[:url],
15
- workspace_id: workspace_id,
16
- api_key: api_key
37
+ url: @data[:url],
38
+ workspace_id: @workspace_id,
39
+ api_key: @api_key
17
40
  )
18
41
  end
42
+
43
+ output = "Sent #{times} new DEV comments to your Orbit workspace"
44
+
45
+ puts output
46
+ return output
19
47
  end
20
48
 
21
- if type == "followers"
22
- DevOrbit::Interactions::Follower.new(
23
- id: data[:follower]["id"],
24
- name: data[:follower]["name"],
25
- username: data[:follower]["username"],
26
- url: data[:follower]["path"],
27
- workspace_id: workspace_id,
28
- api_key: api_key
29
- )
49
+ if @type == "followers"
50
+ counter = 0
51
+ @data[:followers].each do |follower|
52
+ next if follower.nil? || follower.empty?
53
+
54
+ unless @historical_import && @last_orbit_member_timestamp
55
+ next if follower["created_at"] < @last_orbit_member_timestamp unless @last_orbit_member_timestamp.nil?
56
+ end
57
+
58
+ if @last_orbit_member_timestamp && @historical_import == false
59
+ next if follower["created_at"] < @last_orbit_member_timestamp
60
+ end
61
+
62
+ sleep(20) if counter % 100 == 0 && counter != 0 # API rate limiting
63
+
64
+ DevOrbit::Interactions::Follower.new(
65
+ id: follower["id"],
66
+ name: follower["name"],
67
+ username: follower["username"],
68
+ url: follower["path"],
69
+ workspace_id: @workspace_id,
70
+ api_key: @api_key
71
+ )
72
+ counter += 1
73
+ end
74
+ output = "Sent #{counter} new followers to Orbit"
75
+
76
+ puts output
77
+ return output
78
+ end
79
+ end
80
+
81
+ private
82
+
83
+ def last_orbit_activity_timestamp(type)
84
+ @last_orbit_activity_timestamp ||= begin
85
+ if type == "comments"
86
+ activity_type = "custom:dev:comment"
87
+ end
88
+
89
+ if type == "followers"
90
+ return nil
91
+ end
92
+
93
+ OrbitActivities::Request.new(
94
+ api_key: @api_key,
95
+ workspace_id: @workspace_id,
96
+ user_agent: "community-ruby-dev-orbit/#{DevOrbit::VERSION}",
97
+ action: "latest_activity_timestamp",
98
+ filters: { activity_type: activity_type }
99
+ ).response
30
100
  end
31
101
  end
32
102
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DevOrbit
4
- VERSION = "0.2.0"
4
+ VERSION = "0.5.1"
5
5
  end
@@ -8,8 +8,8 @@ module DevOrbit
8
8
  module Scripts
9
9
  class CheckComments < Thor
10
10
  desc "render", "check for new DEV comments and push them to Orbit"
11
- def render
12
- client = DevOrbit::Client.new
11
+ def render(*params)
12
+ client = DevOrbit::Client.new(historical_import: params[0])
13
13
  client.comments
14
14
  end
15
15
  end
@@ -8,8 +8,8 @@ module DevOrbit
8
8
  module Scripts
9
9
  class CheckOrgComments < Thor
10
10
  desc "render", "check for new DEV comments on an organization and push them to Orbit"
11
- def render
12
- client = DevOrbit::Client.new
11
+ def render(*params)
12
+ client = DevOrbit::Client.new(historical_import: params[0])
13
13
  client.organization_comments
14
14
  end
15
15
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_orbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orbit DevRel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-06-02 00:00:00.000000000 Z
12
+ date: 2021-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -101,14 +101,14 @@ dependencies:
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '0.1'
104
+ version: '0.2'
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '0.1'
111
+ version: '0.2'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: rspec
114
114
  requirement: !ruby/object:Gem::Requirement