twitchus 0.0.1 → 0.0.2

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.
data/config.example.yml CHANGED
@@ -3,4 +3,13 @@ port: 6379
3
3
  key: streams
4
4
  streams:
5
5
  - scvrush1
6
+ - dragon
7
+ - dignitasapollo
8
+ - empiretvkas
9
+ - mstephano
10
+ - dignitasselect
11
+ - whitera
12
+ - followgrubby
13
+ - liquidret
14
+ - crank
6
15
  - ConsoleCombat
@@ -4,6 +4,11 @@ require "json"
4
4
  module Twitchus
5
5
  class Checker
6
6
 
7
+ def fetch_all(channels)
8
+ channels.map { |channel| check(channel) }.select { |c| !c.nil? }
9
+ end
10
+
11
+ # Return a list of online channel names
7
12
  def check_all(channels)
8
13
  channels.select { |channel| online?(channel) }
9
14
  end
@@ -1,3 +1,3 @@
1
1
  module Twitchus
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -11,9 +11,15 @@ module Twitchus
11
11
  # Empty the online channel list first
12
12
  @storage.clear
13
13
 
14
- online_channels = @checker.check_all(@config.channels)
14
+ online_channels = @checker.fetch_all(@config.channels)
15
15
  online_channels.each do |channel|
16
- @storage.push channel
16
+ data = {
17
+ name: channel["title"],
18
+ channel: channel["channel"]["login"],
19
+ image: channel["channel"]["image_url_huge"]
20
+ }
21
+
22
+ @storage.push data.to_json
17
23
  end
18
24
  end
19
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitchus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  segments:
205
205
  - 0
206
- hash: 1599783581367613971
206
+ hash: -4568344585535927602
207
207
  required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  none: false
209
209
  requirements:
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  segments:
214
214
  - 0
215
- hash: 1599783581367613971
215
+ hash: -4568344585535927602
216
216
  requirements: []
217
217
  rubyforge_project:
218
218
  rubygems_version: 1.8.24