Module: Seize::Twitch
- Defined in:
- lib/seize/twitch.rb
Constant Summary collapse
- BASE_URL =
'https://api.twitch.tv/kraken'
- HEADERS =
{:accept => 'application/vnd.twitchtv.v3+json', :'client-id' => '2n7irufqjtyyayigyc4ubzq174axeex'}
Class Method Summary collapse
- .get_channel(channel_name) ⇒ Object
-
.get_streams(limit: nil) ⇒ Object
TODO support games paramater.
Class Method Details
.get_channel(channel_name) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/seize/twitch.rb', line 17 def self.get_channel(channel_name) begin channel_response = RestClient.get( "#{BASE_URL}/streams/#{channel_name}", { headers: HEADERS }) JSON.parse(channel_response) rescue RestClient::NotFound nil end end |