The Wave Robot Gateway made it possible to use extended type of email addressing scheme like botname+cool@appspot.com in Wave, XMPP based as Wave is, Wave doesn't support named resources like botname@appspot.com/cool yet. And be warned, if you add a bot with named resources to a wave, its not even detected by the Wave client as a bot anymore so you can't remove it as participant of the wave.

Extending your bot address with meta data gives your bot new possibilities. Below are some possible use cases:

  • adding your bot several times to a wave
  • changing the bot behavior, enable/disable things
  • address to publish something at
  • adding customer username to have customer specific bots

By modifying the ops.py a bit adding these few lines of code you get the possibility to extract the extended email type of meta data.

context.extradata = {}

for key in data.keys():
  context.extradata[key] = data[key]

To use this method just add your bot to your contact list like lets say mybot+something@appspot.com, the following code will add a blip with "something" extracted.

wavelet = context.GetRootWavelet()
doc = wavelet.CreateBlip().GetDocument()
doc.SetText("proxyingFor = "+context.extradata['proxyingFor'])
Habari
You are logged in as Anonymous. Want to Log out?

Reader Commentary

1 people have commented so far.

 

I have nothing interesting to say. I just want to be the first to comment that this really looks interesting! ;)

 

Leave a comment