Quick! Let’s Code a Robot!
In this brief exercise we’ll be developing a simple Python-based robot that responds to blips added by participants. Our Oracle Bot, which we’ll deploy to App Engine, will listen for blips that end with a question mark. Any time a participant submits a blip that ends in a question mark, the Oracle Bot will respond with one of several answers chosen at random. Our goal is to create a playful robot that allows people to ask “the Oracle” all kinds of questions.
You can view the code for this example in its entirety without any breaks in Appendix A. The code is also available on Google Project Hosting: http://code.google.com/p/oracle-bot.
Set Up the App Engine Application
Once you’ve set up an App Engine account, you’ll want to
create a new application that will host the robot. For this sample
robot, I will use
as an
application name. That means that my robot will be hosted at
http://oracle-bot.appspot.com
and that oracle-bot@appspot.com will be its contact
address in the Google Wave Client. Because App Engine application names
are unique, you should set up your own application to use
a different name.oracle-bot
Warning
App Engine currently restricts users to 10 registered applications, including Google Wave robots. Be careful and choose wisely when adding ...
Get Google Wave: Up and Running now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.