Joe Gregorio | 5e4aa15 | 2010-11-04 20:04:40 -0400 | [diff] [blame] | 1 | #!/usr/bin/python2.4 |
| 2 | # -*- coding: utf-8 -*- |
| 3 | # |
| 4 | # Copyright 2010 Google Inc. All Rights Reserved. |
| 5 | |
| 6 | """Simple command-line example for Custom Search. |
| 7 | |
| 8 | Command-line application that does a search. |
| 9 | """ |
| 10 | |
| 11 | __author__ = 'jcgregorio@google.com (Joe Gregorio)' |
| 12 | |
| 13 | from apiclient.discovery import build |
| 14 | |
| 15 | import pprint |
| 16 | |
| 17 | # Uncomment the next line to get very detailed logging |
| 18 | # httplib2.debuglevel = 4 |
| 19 | |
Joe Gregorio | 5e4aa15 | 2010-11-04 20:04:40 -0400 | [diff] [blame] | 20 | |
Joe Gregorio | af276d2 | 2010-12-09 14:26:58 -0500 | [diff] [blame] | 21 | def main(): |
| 22 | p = build("customsearch", "v1", |
| 23 | developerKey="AIzaSyDRRpR3GS1F1_jKNNM9HCNd2wJQyPG3oN0") |
Joe Gregorio | 5e4aa15 | 2010-11-04 20:04:40 -0400 | [diff] [blame] | 24 | res = p.cse().list( |
| 25 | q='lectures', |
| 26 | cx='017576662512468239146:omuauf_lfve', |
| 27 | ).execute() |
| 28 | pprint.pprint(res) |
| 29 | |
| 30 | if __name__ == '__main__': |
| 31 | main() |