reddit_bot 1.7.3 → 1.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/lib/reddit_bot.rb +63 -21
  3. data/reddit_bot.gemspec +9 -13
  4. metadata +11 -73
  5. data/Gemfile +0 -5
  6. data/README.md +0 -101
  7. data/Rakefile +0 -6
  8. data/examples/.bashrc +0 -2
  9. data/examples/.gitignore +0 -2
  10. data/examples/Gemfile.lock +0 -17
  11. data/examples/boilerplate.rb +0 -12
  12. data/examples/councilofricks/Gemfile +0 -4
  13. data/examples/councilofricks/Gemfile.lock +0 -17
  14. data/examples/councilofricks/main.rb +0 -58
  15. data/examples/cptflairbot3/.bashrc +0 -1
  16. data/examples/cptflairbot3/Code.gs +0 -13
  17. data/examples/cptflairbot3/Gemfile +0 -5
  18. data/examples/cptflairbot3/Gemfile.lock +0 -74
  19. data/examples/cptflairbot3/app.js +0 -40
  20. data/examples/cptflairbot3/casual/casualpokemontrades.htm +0 -910
  21. data/examples/cptflairbot3/casual/script.js +0 -55
  22. data/examples/cptflairbot3/casual/style.css +0 -1099
  23. data/examples/cptflairbot3/log.htm +0 -1
  24. data/examples/cptflairbot3/main.rb +0 -62
  25. data/examples/cptflairbot3/package.json +0 -6
  26. data/examples/cptflairbot3/pubsub.rb +0 -30
  27. data/examples/cptflairbot3/update_gas_hook_secret.rb +0 -4
  28. data/examples/devflairbot/Gemfile +0 -6
  29. data/examples/devflairbot/Gemfile.lock +0 -74
  30. data/examples/devflairbot/main.rb +0 -81
  31. data/examples/get_dimensions.rb +0 -212
  32. data/examples/iostroubleshooting/Gemfile +0 -5
  33. data/examples/iostroubleshooting/Gemfile.lock +0 -16
  34. data/examples/iostroubleshooting/main.rb +0 -36
  35. data/examples/johnnymarr/Gemfile +0 -3
  36. data/examples/johnnymarr/Gemfile.lock +0 -17
  37. data/examples/johnnymarr/main.rb +0 -54
  38. data/examples/johnnymarr/twitter.rb +0 -80
  39. data/examples/largeimages/Gemfile +0 -11
  40. data/examples/largeimages/Gemfile.lock +0 -112
  41. data/examples/largeimages/main.rb +0 -167
  42. data/examples/largeimagesreview/Gemfile +0 -4
  43. data/examples/largeimagesreview/Gemfile.lock +0 -15
  44. data/examples/largeimagesreview/main.rb +0 -43
  45. data/examples/mlgtv/Gemfile +0 -4
  46. data/examples/mlgtv/Gemfile.lock +0 -23
  47. data/examples/mlgtv/channels.txt +0 -127
  48. data/examples/mlgtv/main.rb +0 -160
  49. data/examples/net_http_utils.rb +0 -148
  50. data/examples/oneplus/Gemfile +0 -5
  51. data/examples/oneplus/Gemfile.lock +0 -26
  52. data/examples/oneplus/main.rb +0 -43
  53. data/examples/realtimeww2/.bashrc +0 -1
  54. data/examples/realtimeww2/Gemfile +0 -3
  55. data/examples/realtimeww2/Gemfile.lock +0 -17
  56. data/examples/realtimeww2/main.rb +0 -129
  57. data/examples/sexypizza/Gemfile +0 -3
  58. data/examples/sexypizza/Gemfile.lock +0 -15
  59. data/examples/sexypizza/main.rb +0 -33
  60. data/examples/wallpaper/Gemfile +0 -5
  61. data/examples/wallpaper/Gemfile.lock +0 -33
  62. data/examples/wallpaper/main.rb +0 -27
  63. data/examples/yayornay/Gemfile +0 -3
  64. data/examples/yayornay/Gemfile.lock +0 -15
  65. data/examples/yayornay/main.rb +0 -33
  66. data/lib/reddit_bot/version.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bd7532e6902bd9f58fde5dcf8151c9dc408bae4
4
- data.tar.gz: 276fb95038900de070d338744929b9812f77fc88
3
+ metadata.gz: a79ccb6940bda2173afa1e2e1814e89bb0793b72
4
+ data.tar.gz: a7b8a729599ad509480782cffaf5351d5444ac73
5
5
  SHA512:
6
- metadata.gz: 557ea06453ad91faf028dbd42a1b49b1417d34026fb2363e16046d6722dcb159306fe5ed1d5ab6680fc4d7ea1d07445c97b9e4461b1f6bd0c6c2542307e345bb
7
- data.tar.gz: ba95209b0e3ad5abe387f455729334dd6dad6e754b11a581b19ca0ffbf50b1535bde0425340996319f88ebcf9c6c343c0202dabd20981d337072d9f4fd683d18
6
+ metadata.gz: d8aa5d6fd2e4e8f1319eaba631bff0a00f1309e9258917f8d154f6d2a08a9c4751ef14b2ce4c0ad174d55db6dc9a950637eed77748ac3993ec447b88923e50a2
7
+ data.tar.gz: 496c9948ad1a8ddae3a19d12e6280f4f59024f6f2200a8719a8ce2060efdc5264e8a6f6fd198639701cea1eeaf5e2dbb86acc651279c9091bdfaee766a02c5c9
@@ -3,11 +3,10 @@ STDOUT.sync = true
3
3
 
4
4
  require "openssl"
5
5
  require "json"
6
+ require "yaml"
6
7
 
7
8
  require "nethttputils"
8
9
 
9
- require_relative "reddit_bot/version" # TODO: deprecate this
10
-
11
10
  module RedditBot
12
11
  require "logger"
13
12
  class << self
@@ -153,7 +152,9 @@ module RedditBot
153
152
  result["data"].keys == %w{ modhash dist children after before }
154
153
  @@skip_erroneous_descending_ids[ result["data"]["children"].map do |post|
155
154
  fail "unknown type post['kind']: #{post["kind"]}" unless post["kind"] == "t3"
156
- post["data"]
155
+ post["data"].dup.tap do |data|
156
+ data["url"] = "https://www.reddit.com" + data["url"] if /\A\/r\/[0-9a-zA-Z_]+\/comments\/[0-9a-z]{5,6}\// =~ data["url"] if data["crosspost_parent"]
157
+ end
157
158
  end ].each do |data|
158
159
  e << data
159
160
  end
@@ -204,7 +205,7 @@ module RedditBot
204
205
  username: @name,
205
206
  password: @secret_password,
206
207
  }, {
207
- "User-Agent" => "bot/#{@user_agent || @name}/#{RedditBot::VERSION} by /u/nakilon",
208
+ "User-Agent" => "bot/#{@user_agent || @name}/#{Gem::Specification::load("#{__dir__}/../reddit_bot.gemspec").version} by /u/nakilon",
208
209
  }, @secret_auth
209
210
  unless @token_cached = response["access_token"]
210
211
  fail "bot #{@name} isn't a 'developer' of app at https://www.reddit.com/prefs/apps/" if response == {"error"=>"invalid_grant"}
@@ -231,13 +232,13 @@ module RedditBot
231
232
  begin
232
233
  reddit_resp mtd, "https://oauth.reddit.com" + path, form, {
233
234
  "Authorization" => "bearer #{token}",
234
- "User-Agent" => "bot/#{@user_agent || @name}/#{RedditBot::VERSION} by /u/nakilon",
235
+ "User-Agent" => "bot/#{@user_agent || @name}/#{Gem::Specification::load("#{__dir__}/../reddit_bot.gemspec").version} by /u/nakilon",
235
236
  }
236
237
  rescue NetHTTPUtils::Error => e
238
+ raise unless e.code == 401
237
239
  sleep timeout
238
240
  Module.nesting[1].logger.info "sleeping #{timeout} seconds because of #{e.code}"
239
241
  timeout *= 2
240
- raise unless e.code == 401
241
242
  @token_cached = nil
242
243
  retry
243
244
  end
@@ -247,21 +248,7 @@ module RedditBot
247
248
  mtd, url, form, headers, basic_auth = *args
248
249
  headers["Cookie:"] = "over18=1"
249
250
  begin
250
- NetHTTPUtils.request_data(url, mtd, form: form, header: headers, auth: basic_auth) do |response|
251
- next unless remaining = response.to_hash["x-ratelimit-remaining"]
252
- if Gem::Platform.local.os == "darwin"
253
- Module.nesting[1].logger.debug %w{
254
- x-ratelimit-remaining
255
- x-ratelimit-used
256
- x-ratelimit-reset
257
- }.map{ |key| "#{key}=#{response.to_hash[key]}" }.join ", "
258
- end
259
- fail remaining[0] if remaining[0].size < 4
260
- next if remaining[0].size > 4
261
- t = (response.to_hash["x-ratelimit-reset"][0].to_f + 1) / [remaining[0].to_f - 10, 1].max + 1
262
- Module.nesting[1].logger.info "sleeping #{t} seconds because of x-ratelimit"
263
- sleep t
264
- end
251
+ NetHTTPUtils.request_data url, mtd, form: form, header: headers, auth: basic_auth
265
252
  rescue NetHTTPUtils::Error => e
266
253
  sleep 5
267
254
  raise unless e.code.to_s.start_with? "50"
@@ -271,4 +258,59 @@ module RedditBot
271
258
  end
272
259
 
273
260
  end
261
+
262
+ module Twitter
263
+ require "json"
264
+
265
+ def self.init_twitter twitter
266
+ const_set :TWITTER_ACCOUNT, twitter
267
+ const_set :TWITTER_ACCESS_TOKEN, JSON.load(
268
+ NetHTTPUtils.request_data "https://api.twitter.com/oauth2/token", :post,
269
+ auth: File.read("twitter.token").split,
270
+ form: {grant_type: :client_credentials}
271
+ )["access_token"]
272
+ end
273
+
274
+ require "cgi"
275
+ def self.tweet2titleNtext tweet
276
+ text = ""
277
+ contains_media = false
278
+ up = ->s{ s.split.map{ |w| "^#{w}" }.join " " }
279
+ if tweet["extended_entities"] && !tweet["extended_entities"]["media"].empty?
280
+ contains_media = true
281
+ tweet["extended_entities"]["media"].each_with_index do |media, i|
282
+ text.concat "* [Image #{i + 1}](#{media["media_url_https"]})\n\n"
283
+ end
284
+ end
285
+ if !tweet["entities"]["urls"].empty?
286
+ contains_media = true
287
+ tweet["entities"]["urls"].each_with_index do |url, i|
288
+ text.concat "* [Link #{i + 1}](#{url["expanded_url"]})\n\n"
289
+ end
290
+ end
291
+ text.concat "^- #{
292
+ up[tweet["user"]["name"]]
293
+ } [^\\(@#{TWITTER_ACCOUNT}\\)](https://twitter.com/#{TWITTER_ACCOUNT}) ^| [#{
294
+ up[Date.parse(tweet["created_at"]).strftime "%B %-d, %Y"]
295
+ }](https://twitter.com/#{TWITTER_ACCOUNT}/status/#{tweet["id"]})"
296
+ [CGI::unescapeHTML(tweet["full_text"]).sub(/( https:\/\/t\.co\/[0-9a-zA-Z]{10})*\z/, ""), text, contains_media]
297
+ end
298
+
299
+ def self.user_timeline
300
+ timeout = 1
301
+ JSON.load begin
302
+ NetHTTPUtils.request_data(
303
+ "https://api.twitter.com/1.1/statuses/user_timeline.json",
304
+ form: { screen_name: TWITTER_ACCOUNT, count: 200, tweet_mode: "extended" },
305
+ header: { Authorization: "Bearer #{TWITTER_ACCESS_TOKEN}" }
306
+ )
307
+ rescue NetHTTPUtils::Error => e
308
+ fail unless [500, 503].include? e.code
309
+ sleep timeout
310
+ timeout *= 2
311
+ retry
312
+ end
313
+ end
314
+ end
315
+
274
316
  end
@@ -1,25 +1,21 @@
1
- require_relative "lib/reddit_bot/version"
2
-
3
1
  Gem::Specification.new do |spec|
4
2
  spec.name = "reddit_bot"
5
- spec.version = RedditBot::VERSION
6
- spec.authors = ["Victor Maslov"]
7
- spec.email = ["nakilon@gmail.com"]
3
+ spec.version = "1.7.8"
4
+ spec.summary = "Simple library for Reddit bots"
8
5
 
9
- spec.summary = "Library for Reddit bots"
10
- spec.description = "better than PRAW"
11
- spec.homepage = "https://github.com/Nakilon/reddit_bot"
6
+ spec.author = "Victor Maslov aka Nakilon"
7
+ spec.email = "nakilon@gmail.com"
12
8
  spec.license = "MIT"
9
+ spec.metadata = {"source_code_uri" => "https://github.com/Nakilon/reddit_bot"}
13
10
 
14
- spec.files = `git ls-files -z`.split("\x0")#.reject { |f| f.match(%r{^(test|spec|features)/})/ }
15
- # spec.require_paths = ["lib"]
16
-
17
- spec.add_runtime_dependency "json"
18
- spec.add_runtime_dependency "nethttputils", "~>0.3.3.0"
11
+ spec.add_dependency "json"
12
+ spec.add_dependency "nethttputils", "~>0.4.1.0"
19
13
  # spec.add_development_dependency "bundler", "~> 1.11"
20
14
  # spec.add_development_dependency "rake", "~> 10.0"
21
15
  # spec.add_development_dependency "rspec", "~> 3.0"
22
16
  spec.required_ruby_version = ">= 2.0.0"
17
+
18
+ spec.files = %w{ LICENSE.txt reddit_bot.gemspec lib/reddit_bot.rb }
23
19
  end
24
20
 
25
21
  # spec.test_files = ["spec/"]
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.7.3
4
+ version: 1.7.8
5
5
  platform: ruby
6
6
  authors:
7
- - Victor Maslov
7
+ - Victor Maslov aka Nakilon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-08 00:00:00.000000000 Z
11
+ date: 2020-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -30,90 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.3.0
33
+ version: 0.4.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.3.0
41
- description: better than PRAW
42
- email:
43
- - nakilon@gmail.com
40
+ version: 0.4.1.0
41
+ description:
42
+ email: nakilon@gmail.com
44
43
  executables: []
45
44
  extensions: []
46
45
  extra_rdoc_files: []
47
46
  files:
48
- - Gemfile
49
47
  - LICENSE.txt
50
- - README.md
51
- - Rakefile
52
- - examples/.bashrc
53
- - examples/.gitignore
54
- - examples/Gemfile.lock
55
- - examples/boilerplate.rb
56
- - examples/councilofricks/Gemfile
57
- - examples/councilofricks/Gemfile.lock
58
- - examples/councilofricks/main.rb
59
- - examples/cptflairbot3/.bashrc
60
- - examples/cptflairbot3/Code.gs
61
- - examples/cptflairbot3/Gemfile
62
- - examples/cptflairbot3/Gemfile.lock
63
- - examples/cptflairbot3/app.js
64
- - examples/cptflairbot3/casual/casualpokemontrades.htm
65
- - examples/cptflairbot3/casual/script.js
66
- - examples/cptflairbot3/casual/style.css
67
- - examples/cptflairbot3/log.htm
68
- - examples/cptflairbot3/main.rb
69
- - examples/cptflairbot3/package.json
70
- - examples/cptflairbot3/pubsub.rb
71
- - examples/cptflairbot3/update_gas_hook_secret.rb
72
- - examples/devflairbot/Gemfile
73
- - examples/devflairbot/Gemfile.lock
74
- - examples/devflairbot/main.rb
75
- - examples/get_dimensions.rb
76
- - examples/iostroubleshooting/Gemfile
77
- - examples/iostroubleshooting/Gemfile.lock
78
- - examples/iostroubleshooting/main.rb
79
- - examples/johnnymarr/Gemfile
80
- - examples/johnnymarr/Gemfile.lock
81
- - examples/johnnymarr/main.rb
82
- - examples/johnnymarr/twitter.rb
83
- - examples/largeimages/Gemfile
84
- - examples/largeimages/Gemfile.lock
85
- - examples/largeimages/main.rb
86
- - examples/largeimagesreview/Gemfile
87
- - examples/largeimagesreview/Gemfile.lock
88
- - examples/largeimagesreview/main.rb
89
- - examples/mlgtv/Gemfile
90
- - examples/mlgtv/Gemfile.lock
91
- - examples/mlgtv/channels.txt
92
- - examples/mlgtv/main.rb
93
- - examples/net_http_utils.rb
94
- - examples/oneplus/Gemfile
95
- - examples/oneplus/Gemfile.lock
96
- - examples/oneplus/main.rb
97
- - examples/realtimeww2/.bashrc
98
- - examples/realtimeww2/Gemfile
99
- - examples/realtimeww2/Gemfile.lock
100
- - examples/realtimeww2/main.rb
101
- - examples/sexypizza/Gemfile
102
- - examples/sexypizza/Gemfile.lock
103
- - examples/sexypizza/main.rb
104
- - examples/wallpaper/Gemfile
105
- - examples/wallpaper/Gemfile.lock
106
- - examples/wallpaper/main.rb
107
- - examples/yayornay/Gemfile
108
- - examples/yayornay/Gemfile.lock
109
- - examples/yayornay/main.rb
110
48
  - lib/reddit_bot.rb
111
- - lib/reddit_bot/version.rb
112
49
  - reddit_bot.gemspec
113
- homepage: https://github.com/Nakilon/reddit_bot
50
+ homepage:
114
51
  licenses:
115
52
  - MIT
116
- metadata: {}
53
+ metadata:
54
+ source_code_uri: https://github.com/Nakilon/reddit_bot
117
55
  post_install_message:
118
56
  rdoc_options: []
119
57
  require_paths:
@@ -133,5 +71,5 @@ rubyforge_project:
133
71
  rubygems_version: 2.5.2.3
134
72
  signing_key:
135
73
  specification_version: 4
136
- summary: Library for Reddit bots
74
+ summary: Simple library for Reddit bots
137
75
  test_files: []
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- # git: "git@github.com:Nakilon/nethttputils.git", tag: "v0.0.1.4"
data/README.md DELETED
@@ -1,101 +0,0 @@
1
- # RedditBot
2
-
3
- [![Join the chat at https://gitter.im/Nakilon/reddit_bot](https://badges.gitter.im/Nakilon/reddit_bot.svg)](https://gitter.im/Nakilon/reddit_bot)
4
- [![Gem Version](https://badge.fury.io/rb/reddit_bot.svg)](http://badge.fury.io/rb/reddit_bot)
5
-
6
- ### What
7
-
8
- This library provides an easy way to run bots and scripts that use Reddit API.
9
- I ([/u/nakilon](https://www.reddit.com/u/nakilon)) currently run near 10 bots with it.
10
-
11
- ### Why
12
-
13
- Python (and so PRAW) sucks.
14
-
15
- ### Examples
16
-
17
- I'm not usually publish every program (since there are thousand of them and adequate programmer knows that publishing everything is like throwing trash on street) but I'll add bots here so you could see how to use the library.
18
- The [examples folder](examples) includes:
19
-
20
- * **sexypizza** -- bot that updates wiki page with current flairs statistics
21
- * **devflairbot** -- bot that flairs posts when some specifically flaired user comments there
22
- * **mlgtv** -- bot that updates sidebar with currently streaming twitch channels
23
- * **councilofricks** -- bot that flairs users according to Google Spreadsheet
24
- * **wallpaper** -- bot that reports images with dimensions being not the same as in title
25
- * **cptflairbot3** -- bot that sets user flair according to request submitted via web form
26
- also publishes its activily log here http://www.nakilon.pro/casualpokemontrades/log.htm via Google Cloud Platform automations (Apps Script and Functions)
27
- * **oneplus** -- bot that removes and modmails about links to 1080x1920 images
28
- * **yayornay** -- bot that flairs posts according to voting in top level comments
29
- * **realtimeww2** -- bot that posts tweets to a subreddit from a Twitter user timeline
30
- * **johnnymarr** -- another Twitter timeline streaming bot working in the similar way
31
- * **largeimages** -- this was my first bot -- it uses two approaches to track the most high resolution photos posted anywhere on Reddit to x-post them to [subreddit /r/largeimages](https://www.reddit.com/r/largeimages)
32
- * **largeimagesreview** -- script that was used /r/largeimages to calculates quality of x-posts from different subreddits based on mods activity (remove/approve) so it showed that /r/pics and /r/foodporn should better be excluded:
33
-
34
- pics Total: 98 Quality: 19%
35
- wallpapers Total: 69 Quality: 52%
36
- wallpaper Total: 45 Quality: 51%
37
- woahdude Total: 30 Quality: 66%
38
- CityPorn Total: 17 Quality: 82%
39
- FoodPorn Total: 13 Quality: 7%
40
- MapPorn Total: 13 Quality: 46%
41
- SkyPorn Total: 11 Quality: 45%
42
- carporn Total: 11 Quality: 45%
43
- InfrastructurePorn Total: 9 Quality: 77%
44
-
45
- EarthPorn Total: 23 Quality: 82% ✅⛔✅✅✅✅⛔✅✅✅✅✅⛔⛔✅✅✅✅✅✅✅✅✅
46
- FoodPorn Total: 5 Quality: 0% ⛔⛔⛔⛔⛔
47
- carporn Total: 4 Quality: 0% ⛔⛔⛔⛔
48
- CityPorn Total: 4 Quality: 100% ✅✅✅✅
49
- spaceporn Total: 4 Quality: 100% ✅✅✅✅
50
- MapPorn Total: 4 Quality: 50% ✅⛔✅⛔
51
- BotanicalPorn Total: 3 Quality: 66% ✅✅⛔
52
- CemeteryPorn Total: 2 Quality: 0% ⛔⛔
53
- MilitaryPorn Total: 2 Quality: 50% ✅⛔
54
- DessertPorn Total: 2 Quality: 50% ⛔✅
55
- pic Total: 2 Quality: 100% ✅✅
56
- ArchitecturePorn Total: 2 Quality: 50% ✅⛔
57
- AbandonedPorn Total: 2 Quality: 100% ✅✅
58
-
59
- ### Usage
60
-
61
- $ gem install reddit_bot
62
-
63
- or via Gemfile:
64
-
65
- source "https://rubygems.org"
66
- gem "reddit_bot"
67
-
68
- helloworld.rb:
69
-
70
- ```ruby
71
- require "reddit_bot"
72
- ```
73
-
74
- You obviously can't run these examples as is, because they use local configs that are not in git repo, like `secrets.yaml` file for Reddit authorization of the following format:
75
-
76
- :client_id: Kb9.......6wBw
77
- :client_secret: Fqo.....................AFI
78
- :password: mybotpassword
79
- :login: MyBotUsername
80
- # :user_agent: optional_custom_useragent_to_bypass_reddit_spam_protection
81
-
82
- To change log level:
83
-
84
- ```ruby
85
- RedditBot.logger.level = Logger::ERROR
86
- ```
87
-
88
- To update the gem version in Gemfile.lock when using Gemfile like this: `gem "reddit_bot", "~>1.1.0"`, do the:
89
-
90
- $ bundle update reddit_bot
91
-
92
- ### Contributing and License
93
-
94
- Bug reports and pull requests are welcome.
95
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
96
-
97
- ### TODO
98
-
99
- * write more usage instructions here
100
- * manual on how to create bots with Reddit web interface and run via bash console
101
- * about NetHTTPUtils dependency; and that get_response returns String code not Integer like request_data
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
-
3
- # require "rspec/core/rake_task"
4
- # RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
@@ -1,2 +0,0 @@
1
- echo "for get_dimensions.rb self-test: bundle exec ruby get_dimensions.rb"
2
- source ./secrets
@@ -1,2 +0,0 @@
1
- secrets
2
- secrets.yaml
@@ -1,17 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- json (2.1.0)
5
- nethttputils (0.2.5.1)
6
- reddit_bot (1.6.13)
7
- json
8
- nethttputils (~> 0.2.5.1)
9
-
10
- PLATFORMS
11
- ruby
12
-
13
- DEPENDENCIES
14
- reddit_bot
15
-
16
- BUNDLED WITH
17
- 1.17.1
@@ -1,12 +0,0 @@
1
- STDOUT.sync = true
2
- require "pp"
3
-
4
- if Gem.loaded_specs.include? "nethttputils"
5
- require "nethttputils"
6
- else
7
- require_relative "net_http_utils"
8
- end
9
-
10
- require "reddit_bot"
11
-
12
- require "yaml"