My favorites | Sign in
Logo
             
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. All Rights Reserved.
"""Implementation of the Everything and the Kitchen Sink bot

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)

Show details Hide details

Change log

r7 by pamela.fox on May 27, 2009   Diff
adding source code for Yasr and Complety
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 822 bytes, 30 lines

File properties

svn:executable
*
Hosted by Google Code