My favorites | Sign in
Project Home Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python2.4
#
# Copyright 2009 Google Inc.
"""Implementation of the Smiley robot

Yet another smiley robot
"""

__author__ = 'douwe@google.com (Douwe Osinga)'

import logging

from api import events
from api import robot


def OnBlipSubmitted(properties, context):
blip = context.GetBlipById(properties['blipId'])
contents = blip.GetDocument().GetText()
contents = contents.replace(':-(', unichr(0x2639)).replace(':-)', unichr(0x263A))
blip.GetDocument().SetText(contents)

if __name__ == '__main__':
yasr = robot.Robot('Yasr',
image_url='http://wave-api-dmo.appspot.com/public/smiley.png',
profile_url='http://code.google.com')

yasr.RegisterHandler(events.BLIP_SUBMITTED, OnBlipSubmitted)
yasr.Run(debug=True)

Change log

r197 by pamela.fox on Mar 18, 2010   Diff
Hiiiii Google!!!!!!!!!
Go to: 
Project members, sign in to write a code review

Older revisions

r196 by pamela.fox on Mar 16, 2010   Diff
Hiiii SF Wave Meetup!!!!
r195 by pamela.fox on Mar 14, 2010   Diff
HIIIII SXSW!!!!!!!!!!!!!!!!!!!!!!!!
r194 by pamela.fox on Mar 14, 2010   Diff
Fixing Smiley sample.
All revisions of this file

File info

Size: 781 bytes, 30 lines

File properties

svn:executable
*
Powered by Google Project Hosting