Skip to content

Commit 5e4aa15

Browse files
committed
Added Custom Search example
1 parent 618e63b commit 5e4aa15

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

samples/customsearch/main.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
20+
def main():
21+
22+
p = build("customsearch", "v1", developerKey="AIzaSyDRRpR3GS1F1_jKNNM9HCNd2wJQyPG3oN0")
23+
res = p.cse().list(
24+
q='lectures',
25+
cx='017576662512468239146:omuauf_lfve',
26+
).execute()
27+
pprint.pprint(res)
28+
29+
if __name__ == '__main__':
30+
main()

0 commit comments

Comments
 (0)