Class: StoreApi::GooglePlay::Apps::Search
- Inherits:
-
Object
- Object
- StoreApi::GooglePlay::Apps::Search
- Defined in:
- lib/store_api/google_play/apps/search.rb
Overview
google play search class
Constant Summary
Constants included from Request
Instance Attribute Summary collapse
-
#search_list ⇒ Object
Returns the value of attribute search_list.
Instance Method Summary collapse
-
#initialize(search_word, lang = nil, limit = nil, proxy = nil, header = nil) ⇒ Search
constructor
A new instance of Search.
- #main ⇒ Object
Methods included from Card
Methods included from Request
Constructor Details
#initialize(search_word, lang = nil, limit = nil, proxy = nil, header = nil) ⇒ Search
Returns a new instance of Search.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/store_api/google_play/apps/search.rb', line 13 def initialize(search_word,lang=nil,limit=nil,proxy=nil,header=nil) params = {'q' => search_word,'c' => 'apps' } if !lang.nil? params['hl'] = lang end @@path = URI.escape("/store/search") @search_list = [] num = 60 # TODO search limit (0..2).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') @search_list.concat(parse(doc)) rescue => e puts e.backtrace puts e. break end end end |
Instance Attribute Details
#search_list ⇒ Object
Returns the value of attribute search_list.
11 12 13 |
# File 'lib/store_api/google_play/apps/search.rb', line 11 def search_list @search_list end |
Instance Method Details
#main ⇒ Object
37 38 |
# File 'lib/store_api/google_play/apps/search.rb', line 37 def main end |