Module: LiveBlink::CLI::Helper
- Defined in:
- lib/liveblink/cli/fav.rb
Class Method Summary collapse
Class Method Details
.get_datas(links) ⇒ Object
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/liveblink/cli/fav.rb', line 72 def self.get_datas(links) datas = [] i = 0 links.each do |link| links[i] = 'http://www.twitch.tv/' + link datas[i] = Cathodic::TwitchData.new(links[i]) i += 1 end return datas end |
.get_favs ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/liveblink/cli/fav.rb', line 61 def self.get_favs links = [] i = 0 # File.read('../favorites.txt') File.foreach('./lib/favorites.txt') { |stream| links[i] = stream i += 1 } return links end |
.get_online_favs ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/liveblink/cli/fav.rb', line 48 def self.get_online_favs i = 0 datas = [] puts "These streams are online:" datas = self.get_datas(self.get_favs) datas.each do |data| if data.online == true puts data.stream_name + ', playing ' + data.game + ' (' + data.viewers.to_s + ' viewers)' end end end |