Class: PPC::API::Qihu::Keyword

Inherits:
PPC::API::Qihu show all
Defined in:
lib/ppc/api/qihu/keyword.rb

Constant Summary collapse

Service =
'keyword'

Class Method Summary collapse

Methods inherited from PPC::API::Qihu

make_type, process, request_http_body, request_http_header, request_uri, reverse_type, to_id_list, to_json_string

Methods included from PPC::API

#debug_off, #debug_on, #is_no_quota, #make_type, #process, #request, #request_http_body, #request_http_header, #request_uri, #reverse_type

Class Method Details

.add(auth, keywords) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/ppc/api/qihu/keyword.rb', line 32

def self.add( auth,  keywords )
  keyword_types =  make_type( keywords ).to_json
  body = { 'keywords' => keyword_types}
  response = request( auth, Service, 'add', body )
  p response
  process( response, 'keywordIdList'){ |x| to_id_hash_list(x)  }
end

.get(auth, ids) ⇒ Object



25
26
27
28
29
30
# File 'lib/ppc/api/qihu/keyword.rb', line 25

def self.get( auth, ids )
  ids = to_json_string( ids )
  body  = { 'idList' => ids }
  response = request( auth, Service, 'getInfoByIdList', body )
  process( response, 'keywordList'){ |x| reverse_type(x) }
end