twitch 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42dcce08152daf5809e300e8dbce720105a563f8
4
- data.tar.gz: 734d40778e5635ac89d288c63b93e85064133f39
3
+ metadata.gz: 1177e372c0c1af2b6354f96e92f010b987575303
4
+ data.tar.gz: dd49ed0ecb0270d384da5c7377d3407c4d886423
5
5
  SHA512:
6
- metadata.gz: 49e0ae1757007e1a0cd6a682c2ddececc1421f46474e38120c772575e8624b09744d0f0c6d1ad6376b2fc62623942e414ad576fcf885436f141df8dda6ffbf99
7
- data.tar.gz: 6d0b8b3caf0ad9b8d0c29d49329e036f123025104450b11a80dbc529090497dce60206a3d09c7d27c4db0f6bd8fd215afdf0aa4b27785d743b1554441eaffefa
6
+ metadata.gz: 0b8f886b3cd1aec8a5c66400e617ff911e8c9868c2960372760e28dc5919f6806a45e2ffb5869ab6002ec25e68acdbd345fc447dcc0f288a6924df0bfd900c37
7
+ data.tar.gz: f55b7c9969a05256043a18d6d17f4e5d37a03f54ae7fcdf1f76bee8f1d841391825be21b1abab5793f62c9cd6a979d78572cf464edd7aec03d9ea6ef51757176
@@ -16,6 +16,7 @@ module Twitch
16
16
  @adapter = get_adapter(options[:adapter] || nil)
17
17
 
18
18
  @base_url = "https://api.twitch.tv/kraken"
19
+ @alt_base_url = "https://api.twitch.tv/api"
19
20
  end
20
21
 
21
22
  attr_reader :base_url, :redirect_url, :scope
@@ -93,6 +94,15 @@ module Twitch
93
94
  get(url)
94
95
  end
95
96
 
97
+ def channel_panels(channel = nil)
98
+ return nil if channel.nil?
99
+
100
+ path = "/channels/#{channel}/panels"
101
+ url = @alt_base_url + path;
102
+
103
+ get(url)
104
+ end
105
+
96
106
  def your_channel
97
107
  return false unless @access_token
98
108
 
@@ -171,13 +181,6 @@ module Twitch
171
181
 
172
182
  # Streams
173
183
 
174
- def stream(stream_name)
175
- path = "/stream/#{stream_name}"
176
- url = @base_url + path;
177
-
178
- get(url)
179
- end
180
-
181
184
  def stream(stream_name)
182
185
  path = "/streams/#{stream_name}"
183
186
  url = @base_url + path;
@@ -355,16 +358,18 @@ module Twitch
355
358
 
356
359
  # Follows
357
360
 
358
- def following(channel)
361
+ def following(channel, options = {})
362
+ query = build_query_string(options)
359
363
  path = "/channels/#{channel}/follows"
360
- url = @base_url + path;
364
+ url = @base_url + path + query;
361
365
 
362
366
  get(url)
363
367
  end
364
368
 
365
- def followed(username)
369
+ def followed(username, options = {})
370
+ query = build_query_string(options)
366
371
  path = "/users/#{username}/follows/channels"
367
- url = @base_url + path;
372
+ url = @base_url + path + query
368
373
 
369
374
  get(url)
370
375
  end
@@ -3,7 +3,7 @@ module Twitch
3
3
  module VERSION
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 2
6
+ TINY = 3
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].compact.join(".")
9
9
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Lakin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2016-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Simplify Twitch's API for Ruby
@@ -58,13 +58,13 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
+ - lib/twitch.rb
62
+ - lib/twitch/adapters.rb
61
63
  - lib/twitch/adapters/base_adapter.rb
62
64
  - lib/twitch/adapters/httparty_adapter.rb
63
- - lib/twitch/adapters.rb
64
65
  - lib/twitch/client.rb
65
66
  - lib/twitch/request.rb
66
67
  - lib/twitch/version.rb
67
- - lib/twitch.rb
68
68
  homepage: https://github.com/dustinlakin/twitch-rb
69
69
  licenses: []
70
70
  metadata: {}
@@ -74,17 +74,17 @@ require_paths:
74
74
  - lib
75
75
  required_ruby_version: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - '>='
77
+ - - ">="
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - '>='
82
+ - - ">="
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 2.0.14
87
+ rubygems_version: 2.5.1
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Twitch API