reddit_bot 1.6.7 → 1.6.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/cptflairbot3/.bashrc +1 -1
- data/examples/cptflairbot3/Gemfile +2 -1
- data/examples/cptflairbot3/Gemfile.lock +35 -36
- data/examples/cptflairbot3/main.rb +0 -2
- data/examples/devflairbot/main.rb +1 -1
- data/examples/johnnymarr/main.rb +1 -1
- data/examples/largeimages/Gemfile +1 -1
- data/examples/largeimages/Gemfile.lock +7 -11
- data/lib/reddit_bot.rb +2 -2
- data/lib/reddit_bot/version.rb +1 -1
- metadata +2 -3
- data/examples/Gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d49d9769852f275c7f19e57657849f499588ec3a
|
4
|
+
data.tar.gz: 2459d2b20d46c3855f8145630a502093b7f13e1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d3e5dcb3733c164b067a6e091ddf16cceb158b8aecdf38d04fc08b4c285c2d5e935562cd7ebd7805f7ec99edd62cf6779a3d65af0f27665f71604ee2397e496
|
7
|
+
data.tar.gz: dab14e2a4369de529477122c3da9022b72ef91fcd8f480abe1c5a726273bf0713c76515fe0c0e81d46da188a585410e23f1383109d017de29d9dec9bc4b3e830
|
@@ -1 +1 @@
|
|
1
|
-
export
|
1
|
+
export LOGGING_KEYFILE=$GOOGLE_APPLICATION_CREDENTIALS_NAKILONPRO_LOGGING
|
@@ -1,75 +1,74 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git@github.com:Nakilon/gcplogger.git
|
3
|
-
revision:
|
4
|
-
tag: v0.0.0.1
|
3
|
+
revision: 7c1451fac49bd0d242c6de43315ae6e9a70d8f7f
|
5
4
|
specs:
|
6
|
-
gcplogger (0.
|
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.
|
13
|
-
public_suffix (
|
14
|
-
faraday (0.
|
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.
|
16
|
+
google-cloud-core (1.2.3)
|
17
17
|
google-cloud-env (~> 1.0)
|
18
|
-
|
19
|
-
google-cloud-env (1.0.1)
|
18
|
+
google-cloud-env (1.0.2)
|
20
19
|
faraday (~> 0.11)
|
21
|
-
google-cloud-logging (1.
|
22
|
-
google-cloud-core (~> 1.
|
23
|
-
google-gax (~>
|
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 (
|
24
|
+
google-gax (1.3.0)
|
26
25
|
google-protobuf (~> 3.2)
|
27
|
-
googleapis-common-protos (
|
28
|
-
googleauth (~> 0.
|
29
|
-
grpc (
|
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.
|
32
|
-
googleapis-common-protos (1.3.
|
33
|
-
google-protobuf (~> 3.
|
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
|
-
|
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 (
|
38
|
-
logging (~> 2.0)
|
39
|
+
jwt (>= 1.4, < 3.0)
|
39
40
|
memoist (~> 0.12)
|
40
41
|
multi_json (~> 1.11)
|
41
|
-
os (
|
42
|
+
os (>= 0.9, < 2.0)
|
42
43
|
signet (~> 0.7)
|
43
|
-
grpc (1.
|
44
|
+
grpc (1.14.1)
|
44
45
|
google-protobuf (~> 3.1)
|
45
|
-
|
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.
|
50
|
+
multi_json (1.13.1)
|
54
51
|
multipart-post (2.0.0)
|
55
|
-
os (0.
|
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.
|
57
|
+
signet (0.9.0)
|
61
58
|
addressable (~> 2.3)
|
62
59
|
faraday (~> 0.9)
|
63
|
-
jwt (
|
60
|
+
jwt (>= 1.5, < 3.0)
|
64
61
|
multi_json (~> 1.10)
|
65
|
-
stackdriver-core (1.
|
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.
|
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|
|
data/examples/johnnymarr/main.rb
CHANGED
@@ -28,7 +28,7 @@ loop do
|
|
28
28
|
header: { Authorization: "Bearer #{TWITTER_ACCESS_TOKEN}" }
|
29
29
|
)
|
30
30
|
rescue NetHTTPUtils::Error => e
|
31
|
-
fail
|
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|
|
@@ -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.
|
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.
|
88
|
-
mini_portile2 (~> 2.
|
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.
|
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.
|
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,
|
data/lib/reddit_bot/version.rb
CHANGED
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.
|
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-
|
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