From ec736d97fe1352a9686a0f06d3e94cb45849493f Mon Sep 17 00:00:00 2001 From: Joe Gregorio Date: Tue, 21 Dec 2010 16:26:14 -0500 Subject: [PATCH] Added a shopping sample and also adding shopping to api-python-client-doc --- samples/api-python-client-doc/main.py | 1 + samples/shopping/main.py | 32 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 samples/shopping/main.py diff --git a/samples/api-python-client-doc/main.py b/samples/api-python-client-doc/main.py index d5ae558..14f222e 100755 --- a/samples/api-python-client-doc/main.py +++ b/samples/api-python-client-doc/main.py @@ -73,6 +73,7 @@ class MainHandler(webapp.RequestHandler):
  • diacritize
  • translate
  • prediction +
  • shopping """) diff --git a/samples/shopping/main.py b/samples/shopping/main.py new file mode 100644 index 0000000..6dcc948 --- /dev/null +++ b/samples/shopping/main.py @@ -0,0 +1,32 @@ +#!/usr/bin/python2.4 +# -*- coding: utf-8 -*- +# +# Copyright 2010 Google Inc. All Rights Reserved. + +"""Simple command-line example for The Google Shopping API. + +Command-line application that does a search for products. +""" + +__author__ = 'jcgregorio@google.com (Joe Gregorio)' + +from apiclient.discovery import build + +import pprint + +# Uncomment the next line to get very detailed logging +# httplib2.debuglevel = 4 + + +def main(): + p = build("shopping", "v1", + developerKey="AIzaSyDRRpR3GS1F1_jKNNM9HCNd2wJQyPG3oN0") + res = p.products().list( + country='US', + source='public', + q='logitech revue' + ).execute() + pprint.pprint(res) + +if __name__ == '__main__': + main()