Class: StoreApi::GooglePlay::Apps::Developer

Inherits:
Object
  • Object
show all
Includes:
Card, Request
Defined in:
lib/store_api/google_play/apps/developer.rb

Overview

google play developer class

Constant Summary

Constants included from Request

Request::TIME_OUT

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Card

#parse

Methods included from Request

#get, #post, #request

Constructor Details

#initialize(developer_name, lang = nil, proxy = nil, header = nil) ⇒ Developer

Returns a new instance of Developer.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/store_api/google_play/apps/developer.rb', line 13

def initialize(developer_name,lang=nil,proxy=nil,header=nil)
  params = {'id' => developer_name }
  if !lang.nil?
    params['hl'] = lang
  end
  @@path = URI.escape("/store/apps/developer")
  @apps_list = []
  num = 60
  (0..1).each do |start|
    begin
      params['start'] = start*60
      params['num'] = num
      html = post(StoreApi::GooglePlay::HOST,@@path,params,StoreApi::GooglePlay::HTTPS,proxy,header)
      doc = Nokogiri::HTML(html,nil,'utf-8')
      @apps_list.concat(parse(doc))
    rescue => e
      puts e.backtrace
      puts e.message
      break
    end
  end
end

Instance Attribute Details

#apps_listObject

Returns the value of attribute apps_list.



11
12
13
# File 'lib/store_api/google_play/apps/developer.rb', line 11

def apps_list
  @apps_list
end