reddit_bot 1.1.7 → 1.1.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: 71f09acd949afcc9d5273d40debc6742c0e778e0
4
- data.tar.gz: e9e53d49bc24c2d6167fc7a570929201fb35ff60
3
+ metadata.gz: 955203c78488b77ca15aaed4e4701ed2db5542f2
4
+ data.tar.gz: 34d0202710a3414d667a0bcd7d8d3ee1293c4904
5
5
  SHA512:
6
- metadata.gz: c4e13c65fa267c7e519ac853d0299e592a12ebeb33673dd6c86b4be33d2b7bc2b37ea2006d10482a171b1c9e815c073a067b473c7c6e868e9ad3891623584b3b
7
- data.tar.gz: fb589f11556b81e21e8e5489acabe486b4b2f9e2e64477b7d9c5837aa0d999cd8a95ffe7154fb1861f9480044ee5ae41baf0ede7f5bd5b95d101d507f3ac7890
6
+ metadata.gz: a6e8b902086a792a4c65a42721058ab5d65a7d9707fff1b771fc51aa796685a63f5f820f74f2d4357a74c4974260934b718b9fc5d7ea7fa55d74061b59a00d6b
7
+ data.tar.gz: a5b9473a6e09e317b9075a7bb1744f899624356ae960f0c96049a7223265f1ebf89cdb894b50f705261fb3f4d565f63423a0a312b1c46ef171e8ad056512385f
File without changes
@@ -9,7 +9,7 @@ PLATFORMS
9
9
  ruby
10
10
 
11
11
  DEPENDENCIES
12
- reddit_bot (~> 1.1.7)
12
+ reddit_bot (~> 1.1.5)
13
13
 
14
14
  BUNDLED WITH
15
- 1.11.2
15
+ 1.12.5
@@ -1,4 +1,4 @@
1
- require_relative File.join "..", "boilerplate"
1
+ require_relative File.join "../boilerplate"
2
2
 
3
3
  BOT = RedditBot::Bot.new YAML.load(File.read "secrets.yaml"), ignore_captcha: true
4
4
 
@@ -36,8 +36,12 @@ loop do
36
36
  end
37
37
 
38
38
  require "cgi"
39
+ # to update access_token:
40
+ # 0. see 'client_id' here https://www.twitch.tv/settings/connections and 'client_secret' from local ./readme file
41
+ # 1. get 'code' by visiting in browser: https://api.twitch.tv/kraken/oauth2/authorize?response_type=code&client_id=*******&redirect_uri=http://www.example.com/unused/redirect/uri&scope=channel_read channel_feed_read
42
+ # 2. NetHTTPUtils.request_data("https://api.twitch.tv/kraken/oauth2/token", :post, form: {client_id: "*******", client_secret: "*****", grant_type: "authorization_code", redirect_uri: "http://www.example.com/unused/redirect/uri", code: "*******"})
39
43
  JSON.parse(DownloadWithRetry::download_with_retry(
40
- "https://api.twitch.tv/kraken/streams?game=#{CGI::escape "Call of Duty: Black Ops III"}&access_token=#{File.read "twitch.token"}&channel=TyreeLegal,Phizzurp,TheFEARS,CMPLXX,Methodz,Blfire,Tylerfelo,Sender_cw,Diabolic_tv,MJChino,Clayster,Enable,Attach,Zoomaaa,John,ReplaysTV,SpacelyTV,ColeChanTV,SaintsRF,Proofy,Whea7s,ParasiteTV,Ricky,Nameless,Mirx1,Formal,Karma,Scumperjumper,Crimsix,Slacked,Octane,Aqua,Nagafen,Faccento,Jkap,Aches,Teepee,Sharp,Neslo,Goon_jar,TheoryCOD,SteveMochilaCanle,Silly,Merk,Studyy,K1lla93,Burns,Dedo,Swanny,Tommey,DylDaly,Gotaga,QwikerThanU,TCM_Moose,Themarkyb,Maven,MattMrX,CourageJD,Happyy97,Revan,PacmanianDevil,Loonnny,BriceyHD,TeeCM,Senderxz,Zoomaa"
44
+ "https://api.twitch.tv/kraken/streams?game=#{CGI::escape "Call of Duty: Black Ops III"}&access_token=#{File.read("twitch.token").strip}&client_id=#{File.read("client.id").strip}&channel=Ricky,ACHES,Lacefield,Clayster,Enable,Zoomaa,Attach,TheFEARS,PHiZZURP,MiRx1,SaintsRF,StuDyy,SpaceLyTV,NAMELESS,Scumperjumper,FORMAL,Crimsix,Karma,Loony,Slacked,Octane,MJChino,Diabolic_TV,ImTheIvy,Senderxz,Jkap,John,SlasheRAL,Apathy,ColtHavok,MikeSwarley,ParasiteTV,TyreeLegal,Silly,Blfire,methodz,TwiZzyTV,Mochila,Remy,Xotic16,AquA,Faccento,Nagafen,Tylerfelo,TheoryCoD,ColeChanTV,happyy97,goonjar,Burns,Dedo,Neslo,TeeCM,K1lla93,NeLsoNNaTeR,ProoFy,Whea7s,MBoZe,Merk,Nadeshot,ReeP,Sharp,TeePee,Braaain2015,Nolsonn,QwiKeRTHaNu,Zedenyer1,Jurd,Tommey,Swanny,MadCatEU,Rated_EU1,BsportJoshh,Sy_Vortex,TheMarkyB,Peatie95,urbandm,TreiZer0,iDqvee,Tojor,MethodZ_TV,Gotaga,WailersWL,TCM_Moose,RampageSkrapz,Reedy,fighta71,Swiftazor,BacabecNZ,Zeuss_Gaming,Hopeyy,GuydraCOD,mattmrx,Maven,CouRageJD,Revan,BriceyHD,Benson,PHILWHI7"
41
45
  ))["streams"].each do |channel|
42
46
  list << "* [](#twitch) [](#live) [**#{
43
47
  channel["channel"]["display_name"]
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- if ENV["LOGNAME"] == "nakilon"
3
+ if ENV["DEV"]
4
4
  gem "reddit_bot", path: "../.."
5
5
  else
6
6
  gem "reddit_bot", "~>1.1.0"
@@ -1,19 +1,15 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- reddit_bot (1.1.7)
5
- json
6
-
7
1
  GEM
8
2
  remote: https://rubygems.org/
9
3
  specs:
10
4
  json (1.8.3)
5
+ reddit_bot (1.1.7)
6
+ json
11
7
 
12
8
  PLATFORMS
13
9
  ruby
14
10
 
15
11
  DEPENDENCIES
16
- reddit_bot!
12
+ reddit_bot (~> 1.1.0)
17
13
 
18
14
  BUNDLED WITH
19
- 1.11.2
15
+ 1.12.3
data/lib/reddit_bot.rb CHANGED
@@ -8,7 +8,7 @@ require "json"
8
8
 
9
9
 
10
10
  module RedditBot
11
- VERSION = "1.1.7" # :nodoc:
11
+ VERSION = "1.1.8" # :nodoc:
12
12
 
13
13
  class Bot
14
14
 
@@ -218,19 +218,19 @@ module RedditBot
218
218
  # puts request.path
219
219
  # pp request.to_hash
220
220
  # puts request.body
221
- http = begin # I hope this doesn't need retry (Get|Post).new
221
+ http = begin
222
222
  Net::HTTP.start uri.host,
223
223
  use_ssl: uri.scheme == "https",
224
224
  verify_mode: OpenSSL::SSL::VERIFY_NONE,
225
225
  open_timeout: 300
226
- rescue Errno::ECONNRESET, OpenSSL::SSL::SSLError, Net::OpenTimeout, SocketError => e
226
+ rescue OpenSSL::SSL::SSLError, SocketError, Errno::ECONNRESET, Net::OpenTimeout, Errno::ETIMEDOUT => e
227
227
  puts "ERROR: #{e.class}: #{e}"
228
228
  sleep 5
229
229
  retry
230
230
  end
231
231
  response = begin
232
232
  http.request request
233
- rescue Net::ReadTimeout, Errno::EPIPE, EOFError, SocketError, Zlib::BufError, OpenSSL::SSL::SSLError
233
+ rescue OpenSSL::SSL::SSLError, SocketError, Net::ReadTimeout, Errno::EPIPE, EOFError, Zlib::BufError
234
234
  puts "ERROR: network"
235
235
  retry
236
236
  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.1.7
4
+ version: 1.1.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: 2016-06-20 00:00:00.000000000 Z
11
+ date: 2016-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -31,11 +31,11 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - .gitignore
35
34
  - Gemfile
36
35
  - LICENSE.txt
37
36
  - README.md
38
37
  - Rakefile
38
+ - examples/.gitignore
39
39
  - examples/boilerplate.rb
40
40
  - examples/devflairbot/Gemfile
41
41
  - examples/devflairbot/Gemfile.lock
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.0.14
92
+ rubygems_version: 2.0.14.1
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Library for Reddit bots