class Wykop::Operations::Stream

Public Class Methods

new(client) click to toggle source

Documentation: www.wykop.pl/dla-programistow/dokumentacja/#info6_16

# File lib/wykop/operations/stream.rb, line 5
def initialize(client)
  @client = client
  @request = Wykop::Operations::Request.new(@client)
end

Public Instance Methods

replace_url(p = {} ) click to toggle source
# File lib/wykop/operations/stream.rb, line 20
def replace_url(p = {} )
  standard_url = "#{@client.configuration.api_host}/banana/potato/appkey,#{@client.configuration.app_user_key}/userkey,#{@client.user_info['userkey']}/page,#{p[:page]}"
  return standard_url.gsub(/banana/, p[:banana]).gsub(/potato/, p[:potato])
end
stream_hot( p = {} ) click to toggle source
# File lib/wykop/operations/stream.rb, line 15
def stream_hot( p = {} )
  if ! p.has_key?(:page); p[:page] = 0; end
  return @request.execute(replace_url({ :banana => 'stream', :potato => 'hot', :page => p[:page]} ), Hash.new)
end
stream_show( p = {} ) click to toggle source
# File lib/wykop/operations/stream.rb, line 10
def stream_show( p = {} )
  if ! p.has_key?(:page); p[:page] = 0; end
  return @request.execute(replace_url({ :banana => 'stream', :potato => 'index', :page => p[:page]} ), Hash.new)
end