[mq]: oauth2
diff --git a/samples/oauth2/buzz/buzz.py b/samples/oauth2/buzz/buzz.py
new file mode 100644
index 0000000..7df6c72
--- /dev/null
+++ b/samples/oauth2/buzz/buzz.py
@@ -0,0 +1,71 @@
+#!/usr/bin/python2.4
+# -*- coding: utf-8 -*-
+#
+# Copyright 2010 Google Inc. All Rights Reserved.
+
+"""Simple command-line example for Buzz.
+
+Command-line application that retrieves the users
+latest content and then adds a new entry.
+"""
+
+__author__ = 'jcgregorio@google.com (Joe Gregorio)'
+
+from apiclient.discovery import build
+from oauth2client.file import Storage
+
+import httplib2
+import pickle
+import pprint
+
+# Uncomment the next line to get very detailed logging
+#httplib2.debuglevel = 4
+
+
+def main():
+ credentials = Storage('buzz.dat').get()
+
+ http = httplib2.Http()
+ http = credentials.authorize(http)
+
+ p = build("buzz", "v1", http=http, developerKey="AIzaSyDRRpR3GS1F1_jKNNM9HCNd2wJQyPG3oN0")
+ activities = p.activities()
+
+ # Retrieve the first two activities
+ activitylist = activities.list(max_results='2', scope='@self', userId='@me').execute()
+ print "Retrieved the first two activities"
+
+ # Retrieve the next two activities
+ if activitylist:
+ activitylist = activities.list_next(activitylist).execute()
+ print "Retrieved the next two activities"
+
+ # Add a new activity
+ new_activity_body = {
+ "data": {
+ 'title': 'Testing insert',
+ 'object': {
+ 'content': u'Just a short note to show that insert is working. ☄',
+ 'type': 'note'}
+ }
+ }
+ activity = activities.insert(userId='@me', body=new_activity_body).execute()
+ print "Added a new activity"
+
+ activitylist = activities.list(max_results='2', scope='@self', userId='@me').execute()
+
+ # Add a comment to that activity
+ comment_body = {
+ "data": {
+ "content": "This is a comment"
+ }
+ }
+ item = activitylist['items'][0]
+ comment = p.comments().insert(
+ userId=item['actor']['id'], postId=item['id'], body=comment_body
+ ).execute()
+ print 'Added a comment to the new activity'
+ pprint.pprint(comment)
+
+if __name__ == '__main__':
+ main()
diff --git a/samples/oauth2/buzz/web_server_dance.py b/samples/oauth2/buzz/web_server_dance.py
new file mode 100644
index 0000000..7b94103
--- /dev/null
+++ b/samples/oauth2/buzz/web_server_dance.py
@@ -0,0 +1,37 @@
+# Copyright (C) 2010 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Do the OAuth 2.0 Web Server dance.
+
+Do the OAuth 2.0 Web Server dance for
+a command line application. Store the generated
+credentials in a common file that is used by
+other example apps in the same directory.
+"""
+
+__author__ = 'jcgregorio@google.com (Joe Gregorio)'
+
+from oauth2client.client import OAuth2WebServerFlow
+from oauth2client.tools import run
+
+flow = OAuth2WebServerFlow(
+ client_id='anonymous',
+ client_secret='anonymous',
+ scope='https://www.googleapis.com/auth/buzz',
+ user_agent='buzz-cmdline-sample/1.0',
+ domain='anonymous',
+ xoauth_displayname='Buzz Client Example App'
+ )
+
+run(flow, 'buzz.dat')