twitchrb 1.7.0 → 1.8.0

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
  SHA256:
3
- metadata.gz: 93a284aec069a77415cce52d24805ffc047595a7f71641cbeec979444fa12f31
4
- data.tar.gz: efe09b14f083a1e67f8d8b616d4aa792f79861b409b965ceac87baf942b7f30c
3
+ metadata.gz: 9f92c10fcfb6dba2f494d6bd5e0c24bb8cc89662a8dd577d4b8478e744f0f0fa
4
+ data.tar.gz: 32082cfe85dfb4fc7ded29a37b80dc25ce68ccb47481af2957c6a0a990a1c09b
5
5
  SHA512:
6
- metadata.gz: c6229b6097c07070413291d07c3cee543d48c765e1c801047cfd1c10abd2898b976d0d194c133aaddb58fe1d3aad40a4ce24f83674ef8fd7ca35a0cd64951dd0
7
- data.tar.gz: 974fb68d3276cd8536d55a62666ae65957c0f67ab4b421085fd66fca36401e1c7fd659561263baf6d8b2827bb58db5855589b4b635e5ab1ef9a7dcea4ea8a530
6
+ metadata.gz: 0b021607c7e10827384d6d6461b3ba8b9d3f6459996efca1cc276a8e304f9d9ce9c16371e4f6d0a6b136f5ade2cd856d730e38f5f1df94a9d1805f7cf6f1570d
7
+ data.tar.gz: 94e26f89f370b871527b4c76f4aeda72ac77093a5012801efc9cd25695d05e5e683f8e3bbcef9342f0747f6e9595904f9060573e5260de017f8fb8806f9cc13d
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - name: Checkout code
14
- uses: actions/checkout@v5
14
+ uses: actions/checkout@v6
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@v1
17
17
  with:
@@ -31,7 +31,7 @@ jobs:
31
31
  - '3.3'
32
32
  - '3.4'
33
33
  steps:
34
- - uses: actions/checkout@v5
34
+ - uses: actions/checkout@v6
35
35
  - uses: ruby/setup-ruby@v1
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby_version }}
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twitchrb (1.7.0)
4
+ twitchrb (1.8.0)
5
5
  faraday (~> 2.11)
6
6
  ostruct (~> 0.6.0)
7
7
 
data/README.md CHANGED
@@ -190,6 +190,12 @@ attributes = {title: "My new title"}
190
190
 
191
191
  # Retrieves editors for a channel
192
192
  @client.channels.editors(broadcaster_id: 141981764)
193
+
194
+ # Retrieve the Stream Key for a channel
195
+ # broadcaster_id must match the currently authenticated user
196
+ # Required scope: channel:read:stream_key
197
+ @client.channels.stream_key(broadcaster_id: 123123)
198
+ => #<Twitch::StreamKey stream_key="live_abc123">
193
199
  ```
194
200
 
195
201
  ### Videos
@@ -0,0 +1,4 @@
1
+ module Twitch
2
+ class StreamKey < Object
3
+ end
4
+ end
@@ -45,5 +45,10 @@ module Twitch
45
45
  response = get_request("channels/editors?broadcaster_id=#{broadcaster_id}")
46
46
  Collection.from_response(response, type: ChannelEditor)
47
47
  end
48
+
49
+ def stream_key(broadcaster_id:)
50
+ response = get_request("streams/key?broadcaster_id=#{broadcaster_id}")
51
+ StreamKey.new(response.body.dig("data")[0])
52
+ end
48
53
  end
49
54
  end
@@ -1,3 +1,3 @@
1
1
  module Twitch
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
3
  end
data/lib/twitch.rb CHANGED
@@ -59,6 +59,7 @@ module Twitch
59
59
  autoload :User, "twitch/objects/user"
60
60
  autoload :FollowedUser, "twitch/objects/followed_user"
61
61
  autoload :BlockedUser, "twitch/objects/blocked_user"
62
+ autoload :StreamKey, "twitch/objects/stream_key"
62
63
 
63
64
  autoload :Channel, "twitch/objects/channel"
64
65
  autoload :ChannelEditor, "twitch/objects/channel_editor"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitchrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
@@ -94,6 +94,7 @@ files:
94
94
  - lib/twitch/objects/raid.rb
95
95
  - lib/twitch/objects/search_result.rb
96
96
  - lib/twitch/objects/stream.rb
97
+ - lib/twitch/objects/stream_key.rb
97
98
  - lib/twitch/objects/stream_marker.rb
98
99
  - lib/twitch/objects/stream_schedule.rb
99
100
  - lib/twitch/objects/subscription.rb
@@ -168,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
169
  - !ruby/object:Gem::Version
169
170
  version: '0'
170
171
  requirements: []
171
- rubygems_version: 3.7.2
172
+ rubygems_version: 3.6.9
172
173
  specification_version: 4
173
174
  summary: A Ruby library for interacting with the Twitch Helix API
174
175
  test_files: []