reddit_bot 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{.gitignore → examples/.gitignore} +0 -0
- data/examples/mlgtv/Gemfile.lock +2 -2
- data/examples/mlgtv/main.rb +6 -2
- data/examples/yayornay/Gemfile +1 -1
- data/examples/yayornay/Gemfile.lock +4 -8
- data/lib/reddit_bot.rb +4 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 955203c78488b77ca15aaed4e4701ed2db5542f2
|
4
|
+
data.tar.gz: 34d0202710a3414d667a0bcd7d8d3ee1293c4904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6e8b902086a792a4c65a42721058ab5d65a7d9707fff1b771fc51aa796685a63f5f820f74f2d4357a74c4974260934b718b9fc5d7ea7fa55d74061b59a00d6b
|
7
|
+
data.tar.gz: a5b9473a6e09e317b9075a7bb1744f899624356ae960f0c96049a7223265f1ebf89cdb894b50f705261fb3f4d565f63423a0a312b1c46ef171e8ad056512385f
|
File without changes
|
data/examples/mlgtv/Gemfile.lock
CHANGED
data/examples/mlgtv/main.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative File.join "
|
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
|
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"]
|
data/examples/yayornay/Gemfile
CHANGED
@@ -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.
|
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.
|
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
|
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
|
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,
|
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.
|
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-
|
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
|