Status Update: December 21, 2009

1 view
Skip to first unread message

Andrew Hyatt

unread,
Dec 21, 2009, 2:52:08 PM12/21/09
to wave-client-fo...@googlegroups.com
Hi everyone!

I've been hacking on some interesting changes recently. Two notable things:

1) I added Clojure code to get the contents of the wave from the REPL.
I have not yet supported this on the elisp side, though.

2) I've started a new named branch "direct-connect" that abandons the
Clojure REPL with FedOne backend architecture in favor of integrating
directly against the actual JSON Api the wave.google.com uses. Not a
great solution for the long run, but it's actually easier to work with
than the multiple processes and inter-process communication
necessitated by using FedOne. Right now this branch can display your
waves from wave.google.com (main instance only, not sandbox). Having
this data is useful. For example, I can see that just the Wave UI
list needs a lot of work to properly and nicely display.

The new branch's code is often dependent on the numbered JSON fields
which must be the result of a protocol buffer to JSON translation.
It's a bit arbitrary looking in the code, but typically protocol
buffers will not switch field numbers around, so it is actually not as
brittle as it first looks.

Although I intended to keep the UI code the same between different
branches with different backends, I decided to make one change
already, replacing "participants" of a wave, with the single "author"
of a Wave, which I think is more useful information. And it turns out
get can't easily get the complete list of participants from the JSON
API, only the participants on the first wavelet. I intend to backport
that change over to the main FedOne branch.

As usual, if anyone has spare cycles, please let me know if you can
take on some elisp work. Hopefully that work is significantly easier
with the new direct-connect branch.

Daniel Renfer

unread,
Dec 21, 2009, 4:15:56 PM12/21/09
to wave-client-fo...@googlegroups.com
perhaps I'm missing something here, but I can't see how to get this to connect.

I checked out the source, added to my path and required it.

I see the `wave-list-mode' but I just get a message that the wave
client is not running. I've set my username and password in customize.
I guessed at the domain. I wasn't sure if I should put my googlewave
id or the email it's linked to, but I don't think I'm even getting
that far.

Andrew Hyatt

unread,
Dec 21, 2009, 5:12:57 PM12/21/09
to wave-client-fo...@googlegroups.com
Interesting. I neglected to take out some code, but somehow it worked
for me. Hang on and I'll fix this issue.

Andrew Hyatt

unread,
Dec 21, 2009, 5:18:10 PM12/21/09
to wave-client-fo...@googlegroups.com
OK, it should work now. The domain is not yet used (I added a TODO).
Please try again and let me know if you have any other issues.

Daniel Renfer

unread,
Dec 21, 2009, 5:51:53 PM12/21/09
to wave-client-fo...@googlegroups.com
Same thing:

Debugger entered--Lisp error: (error "Wave client not running")
signal(error ("Wave client not running"))
error("Wave client not running")
(if (and wave-client-auth-cookie wave-client-session) nil (error
"Wave client not running"))
(unless (and wave-client-auth-cookie wave-client-session) (error
"Wave client not running"))
wave-client-assert-connected()
wave-list-mode()
call-interactively(wave-list-mode t nil)
execute-extended-command(nil)
call-interactively(execute-extended-command nil nil)


am I supposed to start the wave client manually, or does this do it?

I'm running M-x wave-list-mode

Ubuntu 9.10, emacs 23

Andrew Hyatt

unread,
Dec 21, 2009, 5:59:12 PM12/21/09
to wave-client-fo...@googlegroups.com
I see. Please remove the wave-client-assert-connected for now and try
again. It unfortunately asserts for connectivity before it actually
connects. I'll remove it in the source as well.

Daniel Renfer

unread,
Dec 21, 2009, 6:45:59 PM12/21/09
to wave-client-fo...@googlegroups.com
I'm getting a step further. Now I'm getting a new error. I have also
started a new wave at
https://wave.google.com/wave/#minimized:nav,minimized:contact,restored:search:group%253Awave-client-for-emacs-discuss%2540googlegroups.com,restored:wave:googlewave.com!w%252BdTYCWbhRA
if you prefer to communicate that way.

Debugger entered--Lisp error: (void-function string-replace-match)
(string-replace-match "'" text "\"" nil t)
(or (string-replace-match "'" text "\"" nil t) text)
(let ((double-quoted-text ...)) (or (string-replace-match
"\\([{,]\\)\\([[:word:]_]+\\):" double-quoted-text "\\1\"\\2\":" nil
t) double-quoted-text))
(json-read-from-string (let (...) (or ... double-quoted-text)))
(let ((json-object-type ...) (json-key-type nil))
(json-read-from-string (let ... ...)))
wave-client-json-read("{startupData:{gadget_cache:false},userProfile:{id:'518382405360196202819',username:'duck1...@googlewave.com'},sessionData:{contact_path:'/wave/c',csi_base_url:'https://gg.google.com/csi',static_path:'/wave/static',servlet_path:'/wave',sessionid:'GgCpbsiH'},uploadForm:{attachment_url:'https://wave.googleusercontent.com/wave',upload_uri:'https://wave1.google.com/wave',upload_worker:'https://wave1.google.com/wave/static/script/upload.js'},loginData:{}}")
(setq wave-client-session (wave-client-json-read (match-string 1)))
(save-excursion (set-buffer (wave-client-curl
"https://wave.google.com/wave/" ... ...)) (goto-char (point-min))
(search-forward-regexp "__session = \\({.*}\\);var") (setq
wave-client-session (wave-client-json-read ...))
(search-forward-regexp "json = \\({\"r\":\"^d1\".*}\\);")
(wave-client-json-read (match-string 1)))
(let ((auth-cookie ...)) (save-excursion (set-buffer ...) (goto-char
...) (search-forward-regexp "__session = \\({.*}\\);var") (setq
wave-client-session ...) (search-forward-regexp "json =
\\({\"r\":\"^d1\".*}\\);") (wave-client-json-read ...)))
wave-client-get-waves()
(wave-client-extract-waves (wave-client-get-waves))
wave-inbox()
(wave-list-render-wave-list (wave-inbox))


wave-list-mode()
call-interactively(wave-list-mode t nil)
execute-extended-command(nil)
call-interactively(execute-extended-command nil nil)

It appears that function might be coming from XEmacs. Is that what you
are using, or something else? I'm on GNU Emacs 23 (emacs-snapshot on
Karmic)

Andrew Hyatt

unread,
Dec 21, 2009, 7:08:06 PM12/21/09
to wave-client-fo...@googlegroups.com
Fix submitted. Sorry for the issues. This time I tested out on a
emacs 23 instance started up with -q, and got it to work, so it should
work for you.

If you get any other issues, one of thing that may be happening is
that your HTML may look slightly different than mine, for whatever
reasons, and some regexes are thus not matching. But let me know.

Reply all
Reply to author
Forward
0 new messages