The Twitter Searchy robot is a good example of using Python for a cron job, wave storage, etc: http://wave-samples-gallery.appspot.com/about_app?app_id=107014
<http://wave-samples-gallery.appspot.com/about_app?app_id=107014>I'll put on our to-do list to write an actual article about how to use cron. - pamela On Fri, Apr 16, 2010 at 3:40 AM, threepineapples <[email protected]>wrote: > For those interested i have worked it out by looking at the source of > this app > http://wave-samples-gallery.appspot.com/about_app?app_id=107009 > > You need something like: > import logging > from waveapi import events > from waveapi import robot > from waveapi import blip > from waveapi import element > from waveapi import ops > from waveapi import util > from waveapi import wavelet > from waveapi import appengine_robot_runner > from google.appengine.ext import webapp > from google.appengine.ext.webapp.util import run_wsgi_app > > global myRobot > > #other robot event methods > > class AHandler(webapp.RequestHandler): > def get(self): > #you can now do things here by calling myRobot.someMethod() > > if __name__ == '__main__': > myRobot = robot.Robot('....', > image_url='http://.....appspot.com/assets/icon.png', > profile_url='http://.....appspot.com/') > myRobot.setup_oauth("....", ".....", server_rpc_base='http:// > gmodules.com/api/rpc') > myRobot.register_handler(events.WaveletSelfAdded, OnRobotAdded) > #Note this method is note included in my code snippet > appengine_robot_runner.run(myRobot, True, extra_handlers=[('/ > about',AHandler),]) > > And then in app.yaml, you define a url /about.* that runs the robot > python script. > You can then run http://....appspot.com/about whenever you like (with > a cron job, manually, from some other program, whatever) it will > interact with waves as you program it to in the def get(self): method. > > Note, you will probably want to save wave and wavelet id's in a > database so you can access specific waves using this url, otherwise > you will be limited to making a new wave, and going from there. > > It would have been good if there was some real documentation on how to > do this though. I find it tiresome having to go hunting to find out > something that could have been explained in half a page somewhere! :P > > On Apr 16, 11:37 am, threepineapples <[email protected]> > wrote: > > Hi, > > > > The Active API says that you can use it to run cron jobs on waves. > > I've set up OAuth, but i'm at a lost to what sort of python code i > > actually write to get the robot to run on my command (without > > something happening in wave). > > > > I know how to set up cron jobs in appengine, so i assume i need to set > > up some kind of handler for a new cron URL in my robot, and then have > > that call a robot event or something along those lines, but the Active > > API information stops after explaining how to set up OAuth. There is > > no mention of how to get your robot to respond to external events! > > > > Any help (i'm python preferably) would be appreciated! > > > > -- > > You received this message because you are subscribed to the Google Groups > "Google Wave API" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > [email protected]<google-wave-api%[email protected]> > . > > For more options, visit this group athttp:// > groups.google.com/group/google-wave-api?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Google Wave API" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-wave-api%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-wave-api?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Wave API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.
