Office Hours: 2009-10-15 - NOW CLOSED
Welcome to API office hours! *Please top post your question or comment about the robot, gadget, or embed API to make sure we see it. You can do so by replying to this blip.* *A transcript of this wave will be made publicly available. If you don't want to appear in the transcript, delete your blip after getting a response. Be careful not to remove neighboring blips.* *And don't add robots to this wave!* Reply Edit Reply Edit 3:03 pm James Purser: OKay sorry, had to put something on for the kids so I could have a moment to think. My question is this, I am writing a mailbot that operates via a mail proxy. I'm having some issues with timing but I think that's related to my ADSL connection. However when it does work and mail is returned, the logs show that waves are being created, however I'm not being added to them as I would expect. This is both on the sandbox and the preview. Reply Edit Reply Edit 3:04 pm Pamela: So, you're creating new waves, Java SDK? Reply Edit 3:05 pm James Purser: Python Here's the code by the way: http://code.google.com/p/collabmailbot/source/browse/trunk/src/collabmailbot.py Reply Edit 3:05 pm Pamela: Looking, thanks. Reply Edit 3:06 pm Pamela: So the logs show that new wave operations are happening? (Can you actually verify that the waves are being created in the client?) Reply Edit 3:09 pm James Purser: >From what I can see in the logs, the waves are being created but my account isn't being added, I could be reading it wrong, I'll grab a sample of the logs and post em here. 10-12 07:03PM 29.724rootblip=TBD_conv+root_1 D10-12 07:03PM 29.725Test I10-12 07:03PM 29.725rootblip=TBD_conv+root_3 D10-12 07:03PM 29.725Test I10-12 07:03PM 29.725rootblip=TBD_conv+root_5 That's the badly formatted copy of the logs I'm seeing. Of course the weirder thing is that the same code works in the other bot I'm working on. Reply Edit 3:07 pm Douwe: And you in the participants of the root_wavelet I suppose? Reply Edit 3:07 pm James Purser: Yup. The wave usually has me and the mailbot as participants. Reply Edit 3:09 pm Douwe: Weird. So I am using in a demo robot this code: def OnSelfAdded(properties, context): """Invoked when any participants have been added/removed from the wavelet.""" logging.info('OnSelfAdded') wavelet = context.GetRootWavelet() blip = context.GetBlipById(wavelet.GetRootBlipId()) if blip: wavelet.SetTitle('A wavelet title') new_wavelet = robot_abstract.NewWave(context, wavelet.GetParticipants ()) new_blip = context.GetBlipById(new_wavelet.GetRootBlipId()) new_blip.GetDocument().SetText('A new day and a new wave') That worked at least this morning. Reply Edit 3:10 pm James Purser: here's the function that calls the wave creation: def mailcheck(properties, context, user, **kwargs): logging.debug("Wa hay and off we go") url = "http://mailproxy.collaborynth.com.au" logging.debug(url) username = kwargs.get("USERNAME", None) password = kwargs.get("PASSWORD", None) payload = "func=get_mail" payload += "&user="+username payload += "&password="+password logging.debug(payload) res = urlfetch.fetch(url=url, payload=payload, method=urlfetch.POST, deadline=10) logging.debug(res.status_code) if res.status_code == 200: #logging.debug(res.content) mail_list = json.loads(res.content) for mail in mail_list: try: title = mail['subject'] logging.debug(title) root_wavelet = context.GetRootWavelet() rep_wave = robot_abstract.NewWave(context, root_wavelet.GetParticipants ()) rep_wavelet = rep_wave.CreateBlip() rep_wavelet.GetDocument().SetText(title) except: Reply Edit 3:11 pm Douwe: This try except would make you not notice when it breaks, no? Can you add a log here to exclude that option? Reply Edit 3:12 pm James Purser: I can however, when the function returns properly and doesn't get timed out I get the logging info from the try section (the title and the wave creation statements.) Reply Edit 3:13 pm Douwe: True. Is there any way I can try your robot myself? Reply Edit 3:14 pm James Purser: sure, setup a dummy gmail account, add [email protected] to a wave and put the following into the root blip: get_mail [USERNAME] [PASSWORD] (hence why I say setup a dummy gmail account) Reply Edit 3:14 pm Douwe: Ok. I can look at it somewhat later today. Reply Edit 3:14 pm James Purser: No worries thanks Reply Edit 3:13 pm James Purser: The other problem I have of course is not getting the correct wave id, but I think that's a question pass Reply Edit Reply Edit 3:16 pm James Purser: OKay next question for the Googlers. What's the timetable for opening up the Federation port on the sandbox? Reply Edit 3:16 pm Dan: We're working on it ... details here: http://groups.google.com/group/wave-protocol/browse_thread/thread/4da603d9e1e373f3 Reply Edit 3:17 pm James Purser: schweet. Don't mind me, I'm just eager to have multiple wave servers talking each other, works wonders for my Multiple personalities:) Reply Edit 3:17 pm Dan: I'm eager too -- really want to get it out there Reply Edit 3:17 pm Dan: hahah Reply Edit 3:18 pm James Purser: Also I might pick your brain later on, I'm doing a "Federation for Dummies" type writeup so I might get you to have a look over it at some point. Reply Edit 3:18 pm Dan: Sure, sounds great Reply Edit Reply Edit 3:27 pm Sung Wu: hello, i have a question regarding gadget mode. what is DIFF_ON_OPEN means? does it mean that the gadget state has changed since the last time the gadget was opened? or does it mean the blip's text content has changed since the last time the gadget was opened? Reply Edit 3:32 pm me: It will indicate that the wave is just opened and the user should see how the gadget changed since this user last saw the gadget. This is similar to what you see as highlighted text in blips. The gadget will be able to show the change (if it is programmed to do so), otherwise this mode is the same as VIEW. Note that this is not implemented yet. Ignore this for the time being. Reply Edit Reply Edit 3:36 pm me: You will have the normal state that the gadget should show as usual. Plus you will see an extra previous state. The way to fetch this previous state is not yet defined in the API doc. What the gadget can do is to display the difference between these two states. For example, if this is a chess gadget, it may animate the pieces moving from the old place to the new one. Reply Edit 3:38 pm Sung Wu: thanks for the answer, Vadim. Reply Edit Reply Edit 3:26 pm Alexandro Jimenez: Is there a way to have a robot access the data inside Google Moderator? Reply Edit 3:27 pm Pamela: There's no API for Google Moderator at this time. So you would have to do it not using an API. Reply Edit 3:27 pm Alexandro Jimenez: not using an API? so there are other ways? Reply Edit 3:36 pm Pamela: You could pull the HTML and parse it. It's just not usually considered a good thing to do (depends on the HTML format not changing). Reply Edit 3:37 pm Alexandro Jimenez: oh I see, well that would not really be that great I guess, thanks though, hopefully the API will allow moderator eventually :) Reply Edit 3:50 pm Pamela: The Moderator team would need to create the API. They're thinking about it, as there have been requests, but don't know it would happen soon. What were you going to do with it? Reply Edit 4:02 pm Alexandro Jimenez: well I am building a robot with someone, I mentioned it to you before, the Wave Helper robot, that would answer questions and all f that, but we were planning on using moderator to be sort of like our index of answers, and planned on using the checks and x's to get the robot to post the answer, and at the bottomask if it helped, sort of like the google voicemail transcribe survey Reply Edit 4:08 pm Pamela: Ahkay. Ask me about this in a week, I think I'll have a better answer for you. Reply Edit 3:29 pm Alexandro Jimenez: Ok well is there a way to have a robot, or gadget interact with Google Docs? Reply Edit 3:31 pm Alexandro Jimenez: Maybe not Google Docs itself, but what if it was possible to just copy the html code from the google document when viewed in html version, and have the robot copy that into a wave, as a normal wave, and the synchronize it? Reply Edit 3:33 pm Pamela: Google docs has an API. You could do something like have a user type a URL to a document in a Wave, and if that doc is published, you could pull the feed for the doc and put it in the Wave - you would need to convert the HTML into styles, if you wanted to retain stuff like headings and bold and italics. If doc isnt published, you need to have the user grant your app to pull it. Reply Edit 3:35 pm Alexandro Jimenez: interesting, but is it possible to have it synchronize the data on it's own if there are updates? because I am trying to get the Google \/ \/ave Extensions List to be in wave format, but to have it as a word document as well Reply Edit 3:35 pm Pamela: I suppose the robot could pull the feed on a cron, and then update. Ah, the list. Do you want to make the edits in the doc, or in the wave? I wrote an exporty bot that maybe you could modify, if you wanted to edit it in-Wave. Reply Edit 3:36 pm Alexandro Jimenez: well if it could only be edited in wave, then will do, if it could be in both, then sure, I will settle for something, although I don't think it will be able to transfer the robot's images right? Reply Edit 3:38 pm Pamela: Hmm, you've got quite a lot of formatting and images in that. It's tricky right now to convert HTML > Wave styles and vice versa. Let me try something, 1 min. Reply Edit 3:39 pm Alexandro Jimenez: Ok, well the list I have there is the original list that was created in the sandbox, and has evolved into a better more easy to find information list :) Reply Edit 3:46 pm Pamela (and Alexandro Jimenez): Right. I just ran my exporting bot on a Wave with your list pasted, this is what it makes: http://exporty-bot.appspot.com/export?waveId=wavesandbox.com!w%252BjzgP5OmUO No images, styles, etc, as it only currently parses line breaks. Would be possible to understand the other stuff, just not trivial. Right now you're using an iframe gadget to show it in Wave, right? Reply Edit 3:47 pm Alexandro Jimenez: Interesting there is a box on the very bottom, might of been either the box that contained the table of contents, or the images Reply Edit 3:46 pm Alexandro Jimenez: yes I had to use iframe, in order to have it synced in both sandbox, preview, and webpage Reply Edit 3:49 pm Pamela: Well, if you're up for a coding project, I think it's doable. Probably best to decide where you want to do your editing, and whether you need to retain all styles across every instance. Reply Edit 3:50 pm Alexandro Jimenez: yeah i'll probably get others to help, many people want to have docs able to interact with wave too Reply Edit 3:52 pm Alexandro Jimenez: Although Google Docs has the ability to be edited by the public without logging in, so I could just unrestrict that, for now, until the coding project would be finished, or just for who knows.. Reply Edit 3:56 pm Alexandro Jimenez: Pamela is there a way I could find the code for that robot? Reply Edit Reply Edit 3:58 pm Pamela: http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/robots/python/exporty/ Reply Edit 4:03 pm Alexandro Jimenez: awesome :D by the way would you like for it to be submitted to the extensions list? LOL just wondering, you don't have to Reply Edit 4:09 pm Pamela: It's just a demo bot, so not terribly. I have enough users using my Map Gadget and filing bugs. :) Reply Edit 3:49 pm Csaba S: I'd go with wave, since it's basically an editor. Something like this? :) http://archive.waverz.com/googlewave.com!w%252BZ374f-gmR/wave_archiver_test_wave Reply Edit 3:52 pm Alexandro Jimenez: Interesting how was that done? Reply Edit 3:54 pm Csaba S: by creating a small robot, and a wave<->HTML converter... amongst other less-elegant things. Reply Edit 3:55 pm Alexandro Jimenez: the only thing would be the images of the robots could not be included, but everything else would :D Reply Edit 3:55 pm Csaba S: theoretically, I think the robots DO have the images, haven't geeked it out yet. Reply Edit 3:56 pm Alexandro Jimenez: I mean like the small images on this list: http://sites.google.com/site/gwaveextensions/extensions-list Reply Edit 3:57 pm Pamela: The robot should be able to retrieve Image elements. Reply Edit 4:04 pm Alexandro Jimenez: the one it was used for the page Csaba suggested, or the one you suggested? Reply Edit 4:09 pm Pamela: A theoretical robot. :) Reply Edit Reply Edit 3:40 pm Csaba S: Hi Pamela, Has there been any significant updates on the robot API's inability to fetch tags? Reply Edit 3:42 pm Pamela: Not currently. Reply Edit 3:42 pm Csaba S: Is it in the pipeline and/or any chance for being implemented / deployed in the next month? Reply Edit 3:48 pm Pamela: Not sure.. looking. Reply Edit 3:56 pm Pamela: Okay, we have a temporary solution for you. If you retrieve the data document and specify "tags", you will get back an XML document with the tags in it. You can read the tags from that. You could also set it, but we don't recommend that, because it's not OT-friendly. (You have to completely re-write it, and that may collide). But it should work as a read-only data source for now. Reply Edit 3:58 pm Csaba S: "if you retrieve the data document" I'm currently bound to listening to WAVELET_SELF_ADDED, and BLIP_SUBMITTED. The XML file received from here (as seen on the appspot console) doesn't seem to contain anything related to tags. Can I initiate a data document retrieval programmatically somehow? Reply Edit 3:58 pm Pamela: Ah. We may have removed that data doc. Checking.. Reply Edit 4:01 pm Pamela: It seems we removed it. Robots can't currently retrieve the wavelet that tags are stored in. Reply Edit 4:01 pm Csaba S: aww, I'm being given up upon? :( Reply Edit 4:01 pm Pamela: For our reference, would you want read-only access, or modification as well? Reply Edit 4:03 pm Csaba S: I have a possiblity space mapped for both outcomes. The issue in larger context is http://www.waverz.com/groups Which is a temporary hack for wave discovery -something that is not currently possible out-of-the-box from wave. With read-only access, I could potentially display all of the already existent tags -less work for the users (yay). With read-write access, some kind of opt-in intelligent classification could've been nifty. Reply Edit 4:04 pm Pamela: Your extension relies on users adding it to each wave to get discovered, right? Reply Edit 4:05 pm Csaba S: exactly, and it will remain so -I'm currently opt-in. Reply Edit 4:06 pm Pamela: Okay, I see. We'll look into exposing the tags, but we also have a fair bit of other bugs/requests to work on, so I'm not sure what the timeline looks like. I'll update that issue as we progress. Reply Edit 4:06 pm Csaba S: I understand, and would appreciate it :) Reply Edit 3:54 pm Csaba S: I'm eager, and excited! :) Reply Edit Reply Edit Reply Edit 3:46 pm Sung Wu: hello, i also have a question about robot-gadget communication. :) if a gadget submitDelta(), every gadget instance on the same blip will receive one stateCallback. And the robot will receive one single document_changed event for the gadget state change. Is that correct? Reply Edit Reply Edit 3:50 pm me: No. One submitDelta() may result in multiple state callbacks because each key-value update is done individually and the document may get several fragmented changes. If you modify several keys in a single delta, the key updates may not arrive simultaneously to the gadget instances. Reply Edit 3:51 pm Sung Wu: i see. thanks for the info. Do you know if there is any preference? Does robot get the event earlier than the gadget gets the stateCallback? Reply Edit 3:53 pm me: Your local instance of the gadget, the one that called submitDelta(), will practically always receive the callback before any robot or other client get the update information. However, it's better not to rely on this. Assume that everything is asynchronous. Reply Edit 3:55 pm Sung Wu: ok. On the other end, when robot communicates with gadget by modifying state (assuming the java robot client issue on this is fixed), each gadget instance will get a callback? Reply Edit 3:58 pm me: Yes. One more point: the gadget instances live on the client and the robots are somewhere on the servers. It's possible to modify a state of a gadget that is not instantiated in any client (nobody sees it). But if the gadget has multiple instances in several clients, all these instances will receive the changes made by the robot, Reply Edit 4:00 pm Sung Wu: so if robot modifies state of a gadget that is not instantiated, no gadget instance will get statecallback. When the gadget is instantiated again (when someone views it on a client), it can get the state change modified by robot previously. Reply Edit Reply Edit 4:02 pm me: Yes the new instance will receive the latest state to show. In the future it may also get the information about the changes in the DIFF_ON_OPEN mode. Reply Edit 4:03 pm Sung Wu: thanks for all the answers today. :) Reply Edit 3:00 pm pavan kumar: hi here is my question why does the display pic off everytime i login in my account Reply Edit 3:01 pm Dan: what do you mean by pic off? Reply Edit 3:01 pm pavan kumar: display picture Reply Edit Reply Edit 3:05 pm Dan: in the contacts panel, click your own image, and then select change photo Reply Edit 3:06 pm pavan kumar: thanks sir Reply Edit Reply Edit 2:59 pm Vadim Barsukov: In the preview no longer showing markers of user's presence in the Wave (green points on the avatar). Why? This is a bug or have decided to abandon this feature? Reply Edit Reply Edit 3:00 pm Dan: Hi Vadim -- that's a temporary issue -- we'll turn it back on as soon as we can Reply Edit 3:14 pm Vadim Barsukov: Hi! Thank you for your reply. And then users nervous when they do not see whether there is someone. It's like talking blindly. :) Reply Edit 3:09 pm Vadim Barsukov: Maybe need another marker of the presence of the user in this wave (which is now open in the client)? How do you think? To know that he/ she reads now your blips. Reply Edit 3:10 pm Pamela: Vadim's response below basically answers that -- not everyone will want other users to know what they are reading -- but they may be willing to grant such permission. Reply Edit 3:23 pm Vadim Barsukov: This feature is probably already working for a limited number of users? Some googlers now have green dots, while the other is not. Mastery of the Jedi? :) Reply Edit Reply Edit 3:06 pm me: At the moment the view state is hidden on purpose for privacy reasons. Quite possible that in the future this will be available with explicit user permission. Reply Edit 3:08 pm pavan kumar: ok but the thing is we are unable to reconize wither the certain person is online or not Reply Edit 3:09 pm Pamela: As Dan said, that is a known issue and being fixed. Reply Edit Reply Edit Reply Edit Reply Edit Reply Edit 3:54 pm Joachim Larsen: Hi, Regarding the client / server protocol. I realize that google has stated that they seek community input and seem to be content to let the community suss it out for themselves to start with. I am wondering however if you could be induced to release your thoughts on the matter, for example, minimal functionality that should be supported as you see it. I wouldn't worry too much about 'undue influence' so far we have seen devs being able to voice fairly strong opinions etc. Reply Edit 4:09 pm Pamela: Hi Joachim, we need to close office hours now. Can you post in wave- protocol? Reply Edit 4:21 pm Vadim Barsukov: There was a failure in its wave. My message got lost. Meanwhile, Office Hours closed. :) Maybe the same problem and other users. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
