reddit_bot 1.6.7 → 1.6.8

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
  SHA1:
3
- metadata.gz: 125c3fc98ca91c87bbfbf759229f01a04ab866f8
4
- data.tar.gz: 49bef2ef0766f1926013bb735e772d9dcac4042f
3
+ metadata.gz: d49d9769852f275c7f19e57657849f499588ec3a
4
+ data.tar.gz: 2459d2b20d46c3855f8145630a502093b7f13e1e
5
5
  SHA512:
6
- metadata.gz: e0b083b817628c284c18ff17f5f13e7e5e8de2a35b335024412b34c866774643f5e12409650affb9ffc9db9773e943cb3412767409339783caf73a3068797bef
7
- data.tar.gz: 1855665d51f7c148035bb64ccd3e928966c3c6aa0efea8a09e6e6078793acfc4e8ba40fb389e6bcd490c4579446fa8ee25c5813fc389807af1ae1e45ad20d356
6
+ metadata.gz: 1d3e5dcb3733c164b067a6e091ddf16cceb158b8aecdf38d04fc08b4c285c2d5e935562cd7ebd7805f7ec99edd62cf6779a3d65af0f27665f71604ee2397e496
7
+ data.tar.gz: dab14e2a4369de529477122c3da9022b72ef91fcd8f480abe1c5a726273bf0713c76515fe0c0e81d46da188a585410e23f1383109d017de29d9dec9bc4b3e830
@@ -1 +1 @@
1
- export GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS_NAKILONPRO_LOGGER
1
+ export LOGGING_KEYFILE=$GOOGLE_APPLICATION_CREDENTIALS_NAKILONPRO_LOGGING
@@ -1,4 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gem "reddit_bot", "~>1.3.0"
4
- gem "gcplogger", git: "git@github.com:Nakilon/gcplogger.git", tag: "v0.0.0.1"
4
+ gem "jwt", "<2" # Ruby 2.0
5
+ gem "gcplogger", git: "git@github.com:Nakilon/gcplogger.git"
@@ -1,75 +1,74 @@
1
1
  GIT
2
2
  remote: git@github.com:Nakilon/gcplogger.git
3
- revision: 7adffeeeb9a209d15fdd76451ad1a68846a908dd
4
- tag: v0.0.0.1
3
+ revision: 7c1451fac49bd0d242c6de43315ae6e9a70d8f7f
5
4
  specs:
6
- gcplogger (0.0.0.1)
7
- google-cloud-logging
5
+ gcplogger (0.1.1.0)
6
+ google-cloud-logging (~> 1.4.0)
7
+ public_suffix (~> 2.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.5.1)
13
- public_suffix (~> 2.0, >= 2.0.2)
14
- faraday (0.13.1)
12
+ addressable (2.5.2)
13
+ public_suffix (>= 2.0.2, < 4.0)
14
+ faraday (0.15.2)
15
15
  multipart-post (>= 1.2, < 3)
16
- google-cloud-core (1.0.0)
16
+ google-cloud-core (1.2.3)
17
17
  google-cloud-env (~> 1.0)
18
- googleauth (~> 0.5.1)
19
- google-cloud-env (1.0.1)
18
+ google-cloud-env (1.0.2)
20
19
  faraday (~> 0.11)
21
- google-cloud-logging (1.2.1)
22
- google-cloud-core (~> 1.0)
23
- google-gax (~> 0.8.0)
20
+ google-cloud-logging (1.4.0)
21
+ google-cloud-core (~> 1.1)
22
+ google-gax (~> 1.0)
24
23
  stackdriver-core (~> 1.2)
25
- google-gax (0.8.6)
24
+ google-gax (1.3.0)
26
25
  google-protobuf (~> 3.2)
27
- googleapis-common-protos (~> 1.3.5)
28
- googleauth (~> 0.5.1)
29
- grpc (~> 1.0)
26
+ googleapis-common-protos (>= 1.3.5, < 2.0)
27
+ googleauth (~> 0.6.2)
28
+ grpc (>= 1.7.2, < 2.0)
30
29
  rly (~> 0.2.3)
31
- google-protobuf (3.4.0.2)
32
- googleapis-common-protos (1.3.5)
33
- google-protobuf (~> 3.2)
30
+ google-protobuf (3.6.1)
31
+ googleapis-common-protos (1.3.7)
32
+ google-protobuf (~> 3.0)
33
+ googleapis-common-protos-types (~> 1.0)
34
34
  grpc (~> 1.0)
35
- googleauth (0.5.3)
35
+ googleapis-common-protos-types (1.0.2)
36
+ google-protobuf (~> 3.0)
37
+ googleauth (0.6.6)
36
38
  faraday (~> 0.12)
37
- jwt (~> 1.4)
38
- logging (~> 2.0)
39
+ jwt (>= 1.4, < 3.0)
39
40
  memoist (~> 0.12)
40
41
  multi_json (~> 1.11)
41
- os (~> 0.9)
42
+ os (>= 0.9, < 2.0)
42
43
  signet (~> 0.7)
43
- grpc (1.4.5)
44
+ grpc (1.14.1)
44
45
  google-protobuf (~> 3.1)
45
- googleauth (~> 0.5.1)
46
+ googleapis-common-protos-types (~> 1.0.0)
46
47
  json (2.1.0)
47
48
  jwt (1.5.6)
48
- little-plugger (1.1.4)
49
- logging (2.2.2)
50
- little-plugger (~> 1.1)
51
- multi_json (~> 1.10)
52
49
  memoist (0.16.0)
53
- multi_json (1.12.1)
50
+ multi_json (1.13.1)
54
51
  multipart-post (2.0.0)
55
- os (0.9.6)
52
+ os (1.0.0)
56
53
  public_suffix (2.0.5)
57
54
  reddit_bot (1.3.0)
58
55
  json
59
56
  rly (0.2.3)
60
- signet (0.7.3)
57
+ signet (0.9.0)
61
58
  addressable (~> 2.3)
62
59
  faraday (~> 0.9)
63
- jwt (~> 1.5)
60
+ jwt (>= 1.5, < 3.0)
64
61
  multi_json (~> 1.10)
65
- stackdriver-core (1.2.0)
62
+ stackdriver-core (1.3.0)
63
+ google-cloud-core (~> 1.2)
66
64
 
67
65
  PLATFORMS
68
66
  ruby
69
67
 
70
68
  DEPENDENCIES
71
69
  gcplogger!
70
+ jwt (< 2)
72
71
  reddit_bot (~> 1.3.0)
73
72
 
74
73
  BUNDLED WITH
75
- 1.13.1
74
+ 1.16.1
@@ -5,8 +5,6 @@ require "gcplogger"
5
5
  logger = GCPLogger.logger "cptflairbot3"
6
6
 
7
7
  loop do
8
- Hearthbeat.beat "u_CPTFlairBot3_r_casualpokemontrades", 70 if Google::Cloud.env.compute_engine?
9
-
10
8
  unread = BOT.json :get, "/message/unread"
11
9
  unread["data"]["children"].each do |msg|
12
10
  next logger.info "bad destination: #{msg["data"]["dest"]}" unless msg["data"]["dest"] == "CPTFlairBot3"
@@ -34,7 +34,7 @@ loop do
34
34
  JSON.parse( begin
35
35
  NetHTTPUtils.request_data "https://www.reddit.com/r/#{subreddit}/comments.json", header: ["User-Agent", "ajsdjasdasd"]
36
36
  rescue NetHTTPUtils::Error => e
37
- raise unless [503, 504].include? e.code
37
+ raise unless [503, 504, 500].include? e.code
38
38
  sleep 60
39
39
  retry
40
40
  end )["data"]["children"].each do |comment|
@@ -28,7 +28,7 @@ loop do
28
28
  header: { Authorization: "Bearer #{TWITTER_ACCESS_TOKEN}" }
29
29
  )
30
30
  rescue NetHTTPUtils::Error => e
31
- fail if e.code != 503
31
+ fail unless [500, 503].include? e.code
32
32
  sleep timeout += 1
33
33
  retry
34
34
  end ).sort_by{ |tweet| -tweet["id"] }.take_while do |tweet|
@@ -2,7 +2,7 @@
2
2
 
3
3
  gem "json"
4
4
 
5
- gem "reddit_bot", git: "git@github.com:nakilon/reddit_bot.git"
5
+ gem "reddit_bot"
6
6
  gem "nokogiri"
7
7
 
8
8
  gem "fastimage", git: "git@github.com:sdsykes/fastimage.git", ref: "15bc4111c4c4e1af580b63c62e08decf2d5527d5"
@@ -15,13 +15,6 @@ GIT
15
15
  google-cloud-logging (~> 1.4.0)
16
16
  public_suffix (~> 2.0)
17
17
 
18
- GIT
19
- remote: git@github.com:nakilon/reddit_bot.git
20
- revision: d2ab4765573ea153e34c99b6f6a4f7bca21df6a7
21
- specs:
22
- reddit_bot (1.6.5)
23
- json
24
-
25
18
  GIT
26
19
  remote: git@github.com:sdsykes/fastimage.git
27
20
  revision: 15bc4111c4c4e1af580b63c62e08decf2d5527d5
@@ -80,14 +73,17 @@ GEM
80
73
  little-plugger (~> 1.1)
81
74
  multi_json (~> 1.10)
82
75
  memoist (0.16.0)
83
- mini_portile2 (2.1.0)
76
+ mini_portile2 (2.3.0)
84
77
  multi_json (1.13.1)
85
78
  multipart-post (2.0.0)
86
79
  nethttputils (0.2.4.2)
87
- nokogiri (1.6.8.1)
88
- mini_portile2 (~> 2.1.0)
80
+ nokogiri (1.8.4)
81
+ mini_portile2 (~> 2.3.0)
89
82
  os (0.9.6)
90
83
  public_suffix (2.0.5)
84
+ reddit_bot (1.6.7)
85
+ json
86
+ nethttputils (~> 0.2.4.1)
91
87
  rly (0.2.3)
92
88
  signet (0.8.1)
93
89
  addressable (~> 2.3)
@@ -107,7 +103,7 @@ DEPENDENCIES
107
103
  google-cloud-error_reporting
108
104
  json
109
105
  nokogiri
110
- reddit_bot!
106
+ reddit_bot
111
107
 
112
108
  BUNDLED WITH
113
109
  1.16.1
data/lib/reddit_bot.rb CHANGED
@@ -35,7 +35,7 @@ module RedditBot
35
35
  # [_form] +Array+ or +Hash+ API method params
36
36
  def json mtd, path, _form = []
37
37
  form = Hash[_form]
38
- response = JSON.parse resp_with_token mtd, path, form.merge({api_type: "json"})
38
+ response = JSON.load resp_with_token mtd, path, form.merge({api_type: "json"})
39
39
  if response.is_a?(Hash) && response["json"] && # for example, flairlist.json and {"error": 403} do not have it
40
40
  !response["json"]["errors"].empty?
41
41
  Module.nesting[1].logger.error "ERROR OCCURED on #{[mtd, path]}"
@@ -178,7 +178,7 @@ module RedditBot
178
178
  def token
179
179
  return @token_cached if @token_cached
180
180
  # TODO handle with nive error message if we get 403 -- it's probably because of bad user agent
181
- response = JSON.parse reddit_resp :post,
181
+ response = JSON.load reddit_resp :post,
182
182
  "https://www.reddit.com/api/v1/access_token", {
183
183
  grant_type: "password",
184
184
  username: @name,
@@ -1,3 +1,3 @@
1
1
  module RedditBot
2
- VERSION = "1.6.7" # :nodoc:
2
+ VERSION = "1.6.8" # :nodoc:
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reddit_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.7
4
+ version: 1.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Maslov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-22 00:00:00.000000000 Z
11
+ date: 2018-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -51,7 +51,6 @@ files:
51
51
  - Rakefile
52
52
  - examples/.bashrc
53
53
  - examples/.gitignore
54
- - examples/Gemfile
55
54
  - examples/Gemfile.lock
56
55
  - examples/boilerplate.rb
57
56
  - examples/councilofricks/Gemfile
data/examples/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "json"
4
-
5
- gem "nethttputils", git: "git@github.com:Nakilon/nethttputils.git", tag: "v0.0.4.1"
6
- gem "imgur2array", git: "git@github.com:Nakilon/imgur2array.git", tag: "v0.0.2.7"
7
- gem "fastimage", "1.7.0"