有人为Google Wave开发机器人和/或小工具吗?
我参与沙盒开发已经有几天了,我很想看看其他人对Google Wave API的看法。
我也想知道每个人都在做什么。请分享您的意见和意见!
前往Google Wave 开发人员并阅读博客、论坛,您的所有问题都会得到解答,包括最近发布的有关 Wave 应用程序库的帖子。您还将找到其他开发人员一起玩沙盒。
我还没有尝试过这些小工具,但从我看过它们的角度来看,它们看起来很简单。它们以类似模板的方式实现,您可以轻松地在其中保留状态,从而允许更复杂的事情,例如RSVP列表甚至游戏。
机器人是我最感兴趣的,好吧,我只能说它们真的很容易开发!几乎没有任何努力!哎呀,我会在这里为您编写一个代码:
import waveapi.events
import waveapi.robot
def OnBlipSubmitted(properties, context):
# Get the blip that was just submitted.
blip = context.GetBlipById(properties['blipId'])
# Respond to the blip (i.e. create a child blip)
blip.CreateChild().GetDocument().SetText('That\'s so funny!')
def OnRobotAdded(properties, context):
# Add a message to the end of the wavelet.
wavelet = context.GetRootWavelet()
wavelet.CreateBlip().GetDocument().SetText('Heeeeey everybody!')
if __name__ == '__main__':
# Register the robot.
bot = waveapi.robot.Robot(
'The Annoying Bot',
image_url='http://example.com/annoying-image.gif',
version='1.0',
profile_url='http://example.com/')
bot.RegisterHandler(waveapi.events.BLIP_SUBMITTED, OnBlipSubmitted)
bot.RegisterHandler(waveapi.events.WAVELET_SELF_ADDED, OnRobotAdded)
bot.Run()
Right now I'm working on a Google App Engine project that's going to be a collaborative text adventure game. For this game I made a bot that lets you play it on Wave. It uses Wave's threading of blips to let you branch the game at any point etc. For more info, have a look at the Google Code project page (scroll down a little bit for a screenshot.)
I have been working on Gadgets, using the Wave API. It's pretty easy to work with. For the most part, you can use javascript inside an XML file. You just need to have the proper tags for the XML file. Below is a sample of what a Gadget would look like, this particular gadget retrieves the top headlines from Slashdot and displays them at the top of the Wave. You can learn more about Gadgets here and here. alt text http://www.m1cr0sux0r.com/xml.jpg