Class: Tvteka::Client
- Inherits:
-
Object
- Object
- Tvteka::Client
- Defined in:
- lib/tvteka/client.rb
Class Method Summary collapse
- .live(token, &block) ⇒ Object
- .live_channel(token, channel, &block) ⇒ Object
- .request ⇒ Object
- .session(username, password, options = {}, &block) ⇒ Object
- .verify(token, &block) ⇒ Object
Class Method Details
.live(token, &block) ⇒ Object
17 18 19 20 21 |
# File 'lib/tvteka/client.rb', line 17 def self.live(token, &block) Tvteka::API.new.get(:live, "http://tvteka.com/live", {cookies: {"deviceToken" => token}}) do |response| block.call response end end |
.live_channel(token, channel, &block) ⇒ Object
23 24 25 26 27 |
# File 'lib/tvteka/client.rb', line 23 def self.live_channel(token, channel, &block) Tvteka::API.new.get(:live_channel, "http://tvteka.com/live/#{channel}", {cookies: {"deviceToken" => token}}) do |response| block.call response end end |
.request ⇒ Object
29 30 31 |
# File 'lib/tvteka/client.rb', line 29 def self.request Tvteka::Request.new end |
.session(username, password, options = {}, &block) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/tvteka/client.rb', line 3 def self.session(username, password, = {}, &block) = { "session[login]" => username, "session[password]" => password, "device[type]" => "xmbc", "device[id]" => "c0:3d:45:28:fc:ad" }.merge() Tvteka::API.new.get(:session, "http://tvteka.com/session/register", ) do |response| block.call response end end |