def search_v1(command, vertical="web", version=1, start=0, count=10, lang="en", region="us", more={}): """ command is the query (not escaped) vertical can be web, news, spelling, images lang/region default to en/us - take a look at the the YDN Boss documentation for the supported lang/region values """ url = SEARCH_API_URL_V1 % (vertical, version, quote_plus(command), start, count, lang, region) + params(more) return rest.load_json(url)
def search(command, vertical="web", version=1, start=0, count=10, lang="en", region="us", more={}): """ command is the query (not escaped) vertical can be web, news, spelling, images lang/region default to en/us - take a look at the the YDN Boss documentation for the supported lang/region values """ url = SEARCH_API_URL % (vertical, version, quote_plus(command), start, count, lang, region) + params(more) return rest.load_json(url)
def search(command,bucket="web",count=10,start=0,more={}): params = { 'oauth_version': "1.0", 'oauth_nonce': oauth.generate_nonce(), 'oauth_timestamp': int(time.time()), 'q': quote_plus(command), 'count': count, 'start': start, 'format': 'json', 'ads.recentSource': SOURCE_TAG } params.update(more) url = SEARCH_API_URL_V2 + bucket consumer = oauth.Consumer(CC_KEY,CC_SECRET) req = oauth.Request(method="GET", url=url, parameters=params) signature_method = oauth.SignatureMethod_HMAC_SHA1() req.sign_request(signature_method, consumer, None) return rest.load_json(req.to_url())