I just had a very productive conversation with arithmetric about a "Buddy List" submodule that could come with the Node.Js integration module. Ideally, applications like tic tac toe or (any node.js game) could use this buddy list submodule to allow users to see which of their friends is online. Maybe we could even make this more accessible by allowing anonymous users to have temporary "accounts" (identified by cookie or similiar) that could have buddy lists so people aren't required (yet encouraged) to register at your drupal site.
I would also say facebook connect node.js buddy list but the d7 version of it is still in dev.
Is anything like this in the works?
Comments
Comment #1
Anonymous (not verified) commentedno, but yes please! arithmetric++ LSU_JBob++
Comment #2
LSU_JBob commentedSweet, I wanna figure out some good starting points to this. We're going to have a small code sprint for this tomorrow (June 18th 2011) from 12PM EST to 4PM EST. We'll see what we can hash out.
Comment #3
LSU_JBob commentedThree blocks:
other stuff?
Comment #4
arithmetric commentedMy two cents:
Comment #5
LSU_JBob commentedGreat, thank you arithmetric.
I've made a github repo for this submodule.
https://github.com/johnrobertwilson/Node.js-Buddylist
We also decided to have the back end of the friend logic be managed by Flag and Flag Friend
Comment #6
Anonymous (not verified) commentedI like where this going.
LSU_JBob, lets keep the code on d.o. ok?
Comment #7
LSU_JBob commentedsure, i just didn't want to commit bad code.
I should commit it to the dev branch yes?
Comment #8
arithmetric commentedAfter thinking more on this project, I realize that there's more to do than make flag_friend's buddy list data available through the node.js service. We also need to provide the code for identifying which users are online.
Older buddy list modules would have determined this based on the last time that Drupal saw a given user (i.e. the last time a user hit a page on the Drupal site). This would have given a fuzzy result for whether a user was online, as it would need to allow buffer time since the last hit in case the user is still at the site but sitting on a page.
We could take a new approach and delegate to the node.js service the task of evaluating whether the user is online or not. By maintaining a persistent socket while the user is on a page and dispatching events when a client connects or disconnects, the node.js service is well suited for keeping track of whether a user is on the site. This functionality could be built as a server extension.
The main caveat is that this will only track users who connect to the node.js service (have a compatible browser and JavaScript enabled).
What do you think?
Comment #9
Anonymous (not verified) commentedthinking of committing this as comments to server.js, which is a distillation of a discussion we just had on presence stuff in the ampersand tech office:
Comment #10
LSU_JBob commentedUseful in our case!
Comment #11
Anonymous (not verified) commentedok, i committed a slightly modified version here:
http://drupalcode.org/project/nodejs.git/commit/1e6a4cb
Comment #12
Anonymous (not verified) commentedthe other thing to note is that i think a chunk of this will go in server.js, and some into nodejs.module.
i think these are low level enough that we should add them as primitives to the node.js server and core module, then devs can extend them as they see fit.
Comment #13
LSU_JBob commentedhttp://drupalcode.org/project/nodejs.git/commit/b0fc46b
Initial commit after the nyc drupal playday on 6/18/2011
Feel free to completely rip the code up. Let's talk more about what's going into the core module and what we need to call from this one. I like this "presence lists" idea.
Comment #14
LSU_JBob commentedSo let's talk about this presence lists thing. I was going to add some "add user to channel" stuff for admin view and what not but feel like presence lists would make that redundant.
Comment #15
Anonymous (not verified) commenteda couple of relevant commits:
http://drupalcode.org/project/nodejs.git/commit/3b96e18
http://drupalcode.org/project/nodejs.git/commit/53d606a
add the basics of presence notifications to the core of nodejs.module and server.js.
will try to catch LSU_JBob in IRC to discuss the next bits.
Comment #16
LSU_JBob commentedAwesome, thanks justinrandell, taking a look at this this week.