Module: Rik::Client::Video

Included in:
Rik::Client
Defined in:
lib/rik/client/video.rb

Instance Method Summary collapse

Instance Method Details

#info(*args) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/rik/client/video.rb', line 20

def info(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  
  video_id = args.first
  detailed = options[:detailed] 
  
  begin
    if detailed
      call 'qik.stream.info', create, video_id
    else
      call 'qik.stream.public_info', video_id
    end
  rescue Rik::API::Error => error
    unless error.fault_code == 2002 
      STDERR << error
      nil
    else # invalid session lets renew
      recreate
      retry
    end
  end
end

#public_user_streams(username) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rik/client/video.rb', line 6

def public_user_streams(username)
  begin
    call 'qik.stream.public_user_streams', username
  rescue Rik::API::Error => error
    unless error.fault_code == 2002 
      STDERR << error
      nil
    else # invalid session lets renew
      recreate
      retry
    end
  end
end