Comment Notification via XMPP
Elias Torres: Sam could you add Jabber notifications to the email in the comment form when a new comment has been posted to entry? pleeeeeeeeeeaase.
OK, I’ve added a Register entry to the Nav Bar on the right. It will allow you to specify your preferences, but I haven’t yet connected it to XMPP.
- This service, once available, will only be offered to people who can authenticate with OpenID. I have no interest in maintaining a list of passwords or dealing with password recovery issues.
- While the information in the form will be initially seeded with your remembered comment name, email, and URI (if available), the registration information is completely separate and can be changed independently.
- To send a message, I need to know the XMPP server and the destination resource. To keep this simple, I’m going to try to infer the server from the XMPP address specified, defaulting to Google Talk.
That’s pretty much it. The registration panel is live in that it will capture and display your preferences, but again, at the present time no XMPP messages are generated until I am comfortable that the registration is debugged.
My goal is to keep this simple. If you are looking at a page, three mouse clicks and you can be subscribed (it may take more based on your OpenID provider). One subscription list per OpenID. You can subscribe to all comments, just the entries that you have commented on, or add subscriptions to any of the ten most recently posted or commented on entries.
As an aside, this deceptively simple form has lots of combinations to deal with: new user vs returning user, GET vs POST, cookies available or not, unauthenticated user vs failed authentication vs fully authenticated user vs previously authenticated user whose authentication has timed out. If you find some combination that doesn’t work as you would expect, let me know.
I managed to go through the register process (authenticating through OpenID and so forth), but after entering my Jabber account address, checking “Subscribe to all discussions that you have participated in”, and clicking “Submit”, the registration form just refreshes with the old information in it. I wonder why?
When this is fixed, I have a couple of comments. The “Google Talk ID” you’re asking for was pre-populated with my e-mail address. These will often not be the same; should you perhaps split “Google Talk ID” to its own field and leave “E-mail” as it is? There’s also missing a lot of labels in the registration form.
If this form is supposed to become the main new place for entering user data on Intertwingly, perhaps the comment form can be reduced to just a textarea when you’re logged in? Then, if I want to change the information registered, I can just jump to the registration form and alter the data. And further, it would be neat if that registered data was extracted from my OpenID persona.
After submitting the form, I get a page back that consists of a chunk of JSON, an HTTP header, and then some HTML. Firefox just renders it all as text, but going back to the form, I see it hasn’t remembered my settings.
Posted by Ciaran at
Status update:
- I seem to have Patrick’s execution path working. As I mentioned, the combinatorics on this simple task are astounding.
- And I’ve fixed the missing data that Asbjørn noted, but unfortunately that data was lost on the way in, so Asbjørn will have to resubscribe.
- Ciaran: I’m afraid that what you were seeing was debug information while I was testing, and you too will have to resubscribe.
- Elias: I’ve not yet hooked up XMPP, so I’m not sure what you were testing. :-)
Subscribed again - no debug information this time. I’m in agreement with Asbjørn about prepopulating the “Google Talk ID” with the email address, mine is different as well. You might also guess from the use of those quotes that I find the mislabelling of an entire open protocol with a brand name objectionable too, but it’s your party.
Who’d have thought such a simple feature would generate so much excitement. We’re all desperate to sign up for a some notifications you haven’t even connected up yet!? If I was you I’d start selling boxes of something-you-haven’t-thought-of-yet, I reckon the orders will come flooding in. :)
Posted by Ciaran atSubscription worked for me. An extra round trip, with no error message. I had the wrong address the first time, I wonder if it is related.
Let’s see if I can find time to create a mombo repository before the code base becomes too complex. :)
Posted by Santiago Gala atI’m getting an XML parsing error in Firefox:
XML Parsing Error: no element found
Location: [link]
Line Number 1, Column 1:
^
Ah, it worked after I’d posted that comment (twice... oops!) and selected “Remember info?”
Posted by Rod Begbie at
The “Google Talk ID” you’re asking for was pre-populated with my e-mail address. These will often not be the same; should you perhaps split “Google Talk ID” to its own field and leave “E-mail” as it is?
I have no need to harvest email addresses. All I need for this purpose is an XMPP ID. For some people, pre-populating this field with the email address will save keystrokes and reduce typos. For others, it will require updating.
The human factors issue is more interesting to me. Simply put, people don’t read labels. After thinking about this a bit, I’ve concluded that the way to address that problem is to place a Test XMPP button in front of the Save Changes button.
I find the mislabelling of an entire open protocol with a brand name objectionable
The label now simply reads XMPP ID. With Rod Begbie’s help, I’ve verified that XMPP will store and forward messages, which is very cool. What that means is that I can send to Google Talk and it will forward to the appropriate server, if necessary.
If anybody for any reason wants me to bypass the Googleplex, just let me know what server I should use. I will need to be able to get a user and password on that server.
XML error here too.
From what I have been able to piece together, people have been trained to think of the email address as optional, and hit save. Ron’s original save has since been overwritten, but Dan’s still shows a missing XMPP id.
For those who want to follow along, here is the code. There is a try/except block around most of the code, then the actual response is sent back. For there to be an XML error on line 1, the Content-Type had to be sent, and the next print statement had to die.
I’m guessing that a None got in there, and the escape(None) failed. I’ve added some code to try to ensure that blanks are stored as '', and for good measure, I now output str(user_jid). str(None) is 'None' in Python.
The first click of “Save Changes” successfully redirected to my OpenID provider and back (once I got my URI correct). Now I get a silent reload when I click either “Test XMPP” (with no message received) or “Save Changes”. The problem is probably at my end but I have no information to work out how to fix it.
Posted by Michael C. Harris at
Now I get a silent reload
What is a silent reload? At the moment, both of those buttons are non AJAX type="submit" buttons, and they initiate a complete round trip to the server. That’s normal.
no message received
When I tried to send you an IM to the ID you specified, I got an error code 503.
By the way, I was about to post that I have completed the XMPP code, so everybody who has registered for notification should be seeing this.
Posted by Sam Ruby atSome have reported that they had to manually add
intertwingly@gmail.com as a buddy for this to work. Somewhere along the line, it prompted me to do so.
Posted by Sam Ruby at
Even after adding it to my buddy list, it seems that I’m still not receiving the notices every time.
Posted by James Snell at
What is a silent reload?
By silent reload I mean the page is submitted but there is no indication whether the submission was successful or not.
When I tried to send you an IM to the ID you specified, I got an error code 503.
Ok. I have no idea why. I’ve now added the address manually.
By the way, I was about to post that I have completed the XMPP code, so everybody who has registered for notification should be seeing this.
I did read in your initial post that you hadn’t implemented it yet, but by the time I read the comments, remembered my OpenID login, filled in the form, wondered what was going on, I’d forgotten that bit, so I was expecting a message. My bad.
Posted by Michael C. Harris at
I got the notifications about the comment that Michael just sent via XMPP too. Success!
Posted by Santiago Gala at
Success! The “Test XMPP” worked flawlessly at least. As Michael mentions, a response after hitting submit would be nice. Oh, and you’re still missing a lot of
labels (makes clicking those checkboxes with a mouse unecessarily hard).
Posted by Asbjørn Ulsberg at
Some have reported that they had to manually add intertwingly@gmail.com as a buddy for this to work. Somewhere along the line, it prompted me to do so.
A clean way to avoid this is for you to send a roster request iq message before your first real message, meaning the user gets an “Intertwingly wants to add you, do you want to add them” or similar from their client.
Posted by Ciaran atI’ve added labels, a hover help over the “Text XMPP” button, and added a call to client.sendInitPresence(requestRoster=True) when the Test button is pushed (but not during the normal flow of comment notification).
I do plan on adding a response indication after these buttons are pressed, but before I get around to doing that, I plan on making those buttons use XMLHttpRequest when available.
Now I’m finding myself disappointed that the Google Talk gadget doesn’t support XHTML. Nice work, though, Sam.
Posted by Scott Johnson at
I just got my first comment notification from my previous comment. The text displayed in the plaintext notification is “Comment Notification via XMPP: Posted by Scott Johnson”. Any chance I can get a URL in that message?
Posted by Scott Johnson at
What client are you using, Scott? I use Pidgin, and the “Comment Notification via XMPP” and “Scott Johnson” are hyperlinks.
Posted by Rod Begbie at
Like Rod, what I see is:
Posted by Sam Ruby atComment Notification via XMPP: Posted by Scott Johnson
I’m using the Flash-based Google Talk Gadget, which was designed for iGoogle. When I was registering, I got the following message after hitting the “Test XMPP” button:
This is a plaintext message. If you see this, your client does NOT support XHTML-IM
I think that’s why I’m not getting URLs. Would it be possible to put a plaintext URL in the plaintext notifications?
Posted by Scott Johnson atScott’s previous comment says “Google Talk gadget” and that it doesn’t support xhtml-im. I’m hopefully about to find out if the gmail chat thing does or not...
Posted by Iain at
Nope, it doesn’t. Presumably the gtalk desktop client does though, so it’s only the in-browser clients that fail?
Posted by Iain at
links for 2007-09-28
Share Icon Project - An icon to represent ’sharing’: posting to social sites, sending by e-mail, etc. «An icon representing sharing: posting to social sites, sending via e-mail, etc.» [...]...Excerpt from Logg for Aslak Raanes at
Well the “Test XMPP” is working for me, which I like; even tried closing my Jabber client, sending the test message — when I logged in again the message came through, so yes, the queueing at google appears to be doing the job (I use a Jabber account on my wintermute.com.au domain)
And, having just registered to receive notifications against this post, I’m now testing to see that I’m getting notif’s
I feel certain the notifications are going to get annoying (though for now i’ve only subscribed to “discussions i participate in"), but I have to try for a little while, this is ridiculously cool
oh and i was not-logged-in and don’t use "remember info”; only thing that meant is that when i go back to “register” now, the form is empty and i have to complete it again — not a big deal but now that i’m logged in via openid it’d be nice if it could remember my settings?
thanks
-p
Posted by PeterMHoward atGreat experience !
I was only receiving plain text messages whereas Psi partially supports XHTML-IM, but it now works.
Not sure how necessary it is to use OpenID to subscribe to comment notifications, though.
It could be possible to add an RSS-like button pointing to xmpp:intertwingly@gmail.com/comments?subscribe and perhaps also xmpp:intertwingly@gmail.com?subscribe for blog entries, for easy subscription.
Ideally, it would be used with the PubSub XMPP query type.
And going further, there could be an autodiscovery element like this (the MIME type is probably incorrect) :
<link rel="alternate" type="application/atom+xml" title="It’s just data" href="xmpp:intertwingly@gmail.com?subscribe"/>
Also, using the ad-hoc command, it could be possible to manage subscription directly via the Jabber client similarly to this so that it can be possible to subscribe to the presence stream only for example.
BTW, this blog entry is not index by Google.
Posted by kael atWould it be possible to put a plaintext URL in the plaintext notifications?
Done.
i was not-logged-in and don’t use “remember info”; only thing that meant is that when i go back to “register” now, the form is empty and i have to complete it again — not a big deal but now that i’m logged in via openid it’d be nice if it could remember my settings?
I struggled with this for a while, then went ahead and implemented it. The problem is that the concept of "logged on” really is just a convenient fiction. In this case, what it really means under the covers is “I have a cookie”. I briefly considered adding a “Remember info?” checkbox, but its placement next to a “Save Changes” button would be rather confusing.
And the real problem is that those who need this most are the ones who have not opted in to using cookies.
Anyway, for now, and until I get a better idea, the /registry/ page will always attempt to set a cookie. This allows the XMPP and commenting information to be completely separate.
Not sure how necessary it is to use OpenID to subscribe to comment notifications, though.
All subscription options either involve software that you physically install on your machine or online services that require a login. In this case, I’m hosting the service. I could either implement a login system myself (and require email verifications, etc), or simply rely on OpenID. I chose the latter.
In any case, I do have in place everything that I would need to enable a one click subscription to a specific comment thread, I just want to think a bit more before proceeding down that path.
Posted by Sam Ruby atDone.Would it be possible to put a plaintext URL in the plaintext notifications?
Awesome!
I could either implement a login system myself (and require email verifications, etc), or simply rely on OpenID. I chose the latter.
Personally, I prefer this choice. I don’t need yet another account to remember the password for. I want everything to use my OpenID.
Posted by Scott Johnson at
Sam Ruby: Comment Notification via XMPP
“My goal is to keep this simple. If you are looking at a page, three mouse clicks and you can be subscribed (it may take more based on your OpenID provider). One subscription list per OpenID.”...Excerpt from del.icio.us/tag/openid+xmpp at
links for 2007-10-09
Joe Gregorio | BitWorking | Amazon MP3 Downloads “For the first time in my life I can download music off the internet legally using Amazon’s new MP3 service.” - is it possible Joe’s not familiar w/ eMusic? (tags: emusic amazon mp3 music) The Denver...Excerpt from tecosystems at
FYI, an Ejabberd-AtomPub module has been released. And an Ejabberd-OpenID module also. :)
Posted by kael at
Your Register link is borken for me: [link] . Completely different error from a browser that I’ve not been “remember info’d” on at intertwingly.net.
Posted by Patrick Mueller at