I'm writing a Robot in Python which, in a nutshell, 'reads' Quiz Bowl
questions in a Wave. At the moment, I have it respond to certain
commands by generating a new Blip and placing the full text of a
question in said Blip. It also appends the answer to the question as
an inline Blip.
However, I'm searching for a way to have the Robot incrementally add
the words of the question to the Blip. The current iteration of my
code can be found at <http://code.google.com/p/quizzy/source/browse/ trunk/quizzy.py>, and you can see how OnBlipSubmitted() calls
AskQuestion(), the method which retrieves a question and 'asks' it.
Now, I've tried using time.sleep() to have the robot wait in between
adding text to the document it's working in, but I've noticed that it
doesn't look like Wave is updating the document until after
OnBlipSubmitted() completely finishes.
Is anyone familiar with a technique I can use to get my robot to
incrementally add the words of the question to the document it's
writing and have the document visibly change with each addition?
On Sat, Nov 7, 2009 at 7:14 PM, Daniel Rothenberg <counterstry...@gmail.com>wrote:
> adding text to the document it's working in, but I've noticed that it > doesn't look like Wave is updating the document until after > OnBlipSubmitted() completely finishes.
Robot events are simply HTTP requests. The wave server makes an HTTP request to your robot, provides all of the details of the event in the request, and your robot returns an HTTP response that contains the operations your robot wishes to perform in response to that event. You only get one set of operations per event, and all of those must be returned and processed at once. You can't sleep between incremental updates, because the incremental updates are all sent as one set of operations, and you're just delaying when those operations get sent back to the server.
> Is anyone familiar with a technique I can use to get my robot to > incrementally add the words of the question to the document it's > writing and have the document visibly change with each addition?
> On Sat, Nov 7, 2009 at 7:14 PM, Daniel Rothenberg
> <counterstry...@gmail.com>wrote:
> > adding text to the document it's working in, but I've noticed that it
> > doesn't look like Wave is updating the document until after
> > OnBlipSubmitted() completely finishes.
> Robot events are simply HTTP requests. The wave server makes an HTTP
> request to your robot, provides all of the details of the event in the
> request, and your robot returns an HTTP response that contains the
> operations your robot wishes to perform in response to that event. You only
> get one set of operations per event, and all of those must be returned and
> processed at once. You can't sleep between incremental updates, because the
> incremental updates are all sent as one set of operations, and you're just
> delaying when those operations get sent back to the server.
> > Is anyone familiar with a technique I can use to get my robot to
> > incrementally add the words of the question to the document it's
> > writing and have the document visibly change with each addition?
you could possibly write an extension that took the blip from a
specific bot and display it at the desired speed. though it might be
easier to simply rewrite the bot as an extension in that case however.
On Nov 8, 4:38 pm, Daniel Rothenberg <counterstry...@gmail.com> wrote:
> Thanks, David. I'll play around with the cron job idea, but it looks
> like I'll have to compromise and figure out a different behavior for
> the robot.
> - Daniel
> On Nov 8, 2:19 am, David Nesting <da...@fastolfe.net> wrote:
> > On Sat, Nov 7, 2009 at 7:14 PM, Daniel Rothenberg
> > <counterstry...@gmail.com>wrote:
> > > adding text to the document it's working in, but I've noticed that it
> > > doesn't look like Wave is updating the document until after
> > > OnBlipSubmitted() completely finishes.
> > Robot events are simply HTTP requests. The wave server makes an HTTP
> > request to your robot, provides all of the details of the event in the
> > request, and your robot returns an HTTP response that contains the
> > operations your robot wishes to perform in response to that event. You only
> > get one set of operations per event, and all of those must be returned and
> > processed at once. You can't sleep between incremental updates, because the
> > incremental updates are all sent as one set of operations, and you're just
> > delaying when those operations get sent back to the server.
> > > Is anyone familiar with a technique I can use to get my robot to
> > > incrementally add the words of the question to the document it's
> > > writing and have the document visibly change with each addition?
If you want to do it with Robots, you may get the functionality soon,
as it looks like the Wave team is building a version of the API where
the Robot can send messages, at least to get context of blips, this
may mean good things for the Robot sending messages and having text
appear incrementally (you might be able to send a message telling wave
to update the blip with your new text).
aus...@wavesandbox.com:
you can perform action to that blip such as appending, etc. But you
still have no context to its actual content, like if you want to
parse
out any FormElement within the blip. A new mechanism we are working
is the active gateway API which will allow a robot to make active
request to wave to retrieve full context of any blip.
11:17 am
Also, an alternative method that you might try (though it probably
doesn't work), is to have the robot
On Nov 18, 11:49 pm, Bryan Devaney <bryan.deva...@gmail.com> wrote:
> you could possibly write an extension that took the blip from a
> specific bot and display it at the desired speed. though it might be
> easier to simply rewrite the bot as an extension in that case however.
> On Nov 8, 4:38 pm, Daniel Rothenberg <counterstry...@gmail.com> wrote:
> > Thanks, David. I'll play around with the cron job idea, but it looks
> > like I'll have to compromise and figure out a different behavior for
> > the robot.
> > - Daniel
> > On Nov 8, 2:19 am, David Nesting <da...@fastolfe.net> wrote:
> > > On Sat, Nov 7, 2009 at 7:14 PM, Daniel Rothenberg
> > > <counterstry...@gmail.com>wrote:
> > > > adding text to the document it's working in, but I've noticed that it
> > > > doesn't look like Wave is updating the document until after
> > > > OnBlipSubmitted() completely finishes.
> > > Robot events are simply HTTP requests. The wave server makes an HTTP
> > > request to your robot, provides all of the details of the event in the
> > > request, and your robot returns an HTTP response that contains the
> > > operations your robot wishes to perform in response to that event. You only
> > > get one set of operations per event, and all of those must be returned and
> > > processed at once. You can't sleep between incremental updates, because the
> > > incremental updates are all sent as one set of operations, and you're just
> > > delaying when those operations get sent back to the server.
> > > > Is anyone familiar with a technique I can use to get my robot to
> > > > incrementally add the words of the question to the document it's
> > > > writing and have the document visibly change with each addition?