Class: Tvteka::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/tvteka/client.rb

Class Method Summary collapse

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

.requestObject



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, options = {}, &block)
  options = { "session[login]" => username, "session[password]" => password, "device[type]" => "xmbc", "device[id]" => "c0:3d:45:28:fc:ad" }.merge(options)
  
  Tvteka::API.new.get(:session, "http://tvteka.com/session/register", options) do |response|
    block.call response
  end
end

.verify(token, &block) ⇒ Object



11
12
13
14
15
# File 'lib/tvteka/client.rb', line 11

def self.verify(token, &block)
  Tvteka::API.new.get(:verify, "http://tvteka.com/session/verify", {cookies: {"deviceToken" => token}}) do |response|
    block.call response
  end
end