twitchrb 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/twitch/client.rb +1 -22
- data/lib/twitch/resources/clips.rb +4 -0
- data/lib/twitch/version.rb +1 -1
- data/lib/twitch.rb +0 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30b0eac63e649a017a1c4938b034886f1934da667145ca984f7d2898220d9c91
|
4
|
+
data.tar.gz: 97883516313836adc1a003649904b532c66ce5f14568981d5f82b21b807f489b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5337a58e97212f82d77208f41a0af2b2b0f5b36c3652b7905c51af117e67767affe6a1388e647ed8e4f8ed307488084ee91989cc1a21494265dd5abba9055eea
|
7
|
+
data.tar.gz: 4a95c514a5d1addd4eebd265ba04ba79ae945913042ee4245d07a563e69bf37d365a49d31078130c425a5b545128886058211db96cc3444ff32bd56ebaa31490
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
twitchrb (0.2.
|
4
|
+
twitchrb (0.2.2)
|
5
5
|
faraday (~> 1.7)
|
6
6
|
faraday_middleware (~> 1.1)
|
7
7
|
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
faraday-net_http_persistent (1.2.0)
|
29
29
|
faraday-patron (1.0.0)
|
30
30
|
faraday-rack (1.0.0)
|
31
|
-
faraday_middleware (1.
|
31
|
+
faraday_middleware (1.2.0)
|
32
32
|
faraday (~> 1.0)
|
33
33
|
minitest (5.14.1)
|
34
34
|
multipart-post (2.1.1)
|
data/lib/twitch/client.rb
CHANGED
@@ -1,25 +1,3 @@
|
|
1
|
-
# require "httparty"
|
2
|
-
|
3
|
-
|
4
|
-
# def headers(kind)
|
5
|
-
# if kind == :helix
|
6
|
-
# {
|
7
|
-
# "Client-ID" => @client_id,
|
8
|
-
# "Accept" => "application/json",
|
9
|
-
# "Content-Type" => "application/json",
|
10
|
-
# "Authorization" => "Bearer #{@access_token}"
|
11
|
-
# }
|
12
|
-
# else
|
13
|
-
# {
|
14
|
-
# "Client-ID" => @client_id,
|
15
|
-
# "Accept" => "application/vnd.twitchtv.v5+json",
|
16
|
-
# # "Authorization" => "OAuth #{@access_token}"
|
17
|
-
# }
|
18
|
-
# end
|
19
|
-
# end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
1
|
module Twitch
|
24
2
|
class Client
|
25
3
|
BASE_URL = "https://api.twitch.tv/helix"
|
@@ -144,5 +122,6 @@ module Twitch
|
|
144
122
|
conn.adapter adapter, @stubs
|
145
123
|
end
|
146
124
|
end
|
125
|
+
|
147
126
|
end
|
148
127
|
end
|
@@ -8,6 +8,10 @@ module Twitch
|
|
8
8
|
Collection.from_response(response, type: Clip)
|
9
9
|
end
|
10
10
|
|
11
|
+
def retrieve(id:)
|
12
|
+
Clip.new get_request("clips?id=#{id}").body.dig("data")[0]
|
13
|
+
end
|
14
|
+
|
11
15
|
# Required scope: clips:edit
|
12
16
|
def create(broadcaster_id:, **attributes)
|
13
17
|
response = post_request("clips", body: attributes.merge(broadcaster_id: broadcaster_id))
|
data/lib/twitch/version.rb
CHANGED
data/lib/twitch.rb
CHANGED
@@ -3,26 +3,6 @@ require "faraday_middleware"
|
|
3
3
|
require "json"
|
4
4
|
require "twitch/version"
|
5
5
|
|
6
|
-
require "twitch/version"
|
7
|
-
|
8
|
-
# require "twitch/client"
|
9
|
-
# require "twitch/initializable"
|
10
|
-
|
11
|
-
# # Models
|
12
|
-
# require "twitch/models/channel"
|
13
|
-
# require "twitch/models/badge"
|
14
|
-
# require "twitch/models/game"
|
15
|
-
# require "twitch/models/emote"
|
16
|
-
# require "twitch/models/poll"
|
17
|
-
# require "twitch/models/poll_choice"
|
18
|
-
|
19
|
-
# # Helix API
|
20
|
-
# require "twitch/channels"
|
21
|
-
# require "twitch/emotes"
|
22
|
-
# require "twitch/badges"
|
23
|
-
# require "twitch/games"
|
24
|
-
# require "twitch/polls"
|
25
|
-
|
26
6
|
module Twitch
|
27
7
|
|
28
8
|
autoload :Client, "twitch/client"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitchrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dean Perry
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|