Joe Gregorio | a2f56e7 | 2010-09-09 15:15:56 -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 Buzz. |
| 7 | |
| 8 | Command-line application that retrieves the users |
| 9 | latest content and then adds a new entry. |
| 10 | """ |
| 11 | |
| 12 | __author__ = 'jcgregorio@google.com (Joe Gregorio)' |
| 13 | |
| 14 | |
| 15 | from apiclient.discovery import build |
| 16 | |
| 17 | import httplib2 |
| 18 | import pickle |
| 19 | |
| 20 | |
| 21 | def main(): |
| 22 | f = open("moderator.dat", "r") |
| 23 | credentials = pickle.loads(f.read()) |
| 24 | f.close() |
| 25 | |
| 26 | http = httplib2.Http() |
| 27 | http = credentials.authorize(http) |
| 28 | |
| 29 | p = build("moderator", "v1", http=http) |
Joe Gregorio | 5f087cf | 2010-09-20 16:08:07 -0400 | [diff] [blame] | 30 | print p.submissions().list(seriesId="7035", topicId="64").execute() |
Joe Gregorio | a2f56e7 | 2010-09-09 15:15:56 -0400 | [diff] [blame] | 31 | |
| 32 | if __name__ == '__main__': |
| 33 | main() |