# Campfire like chat plugin?

**URL:** <https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962>\
**Category:** Rails\
**Created:** [October 22, 2007, 9:03pm UTC](https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962 "2007-10-22T21:03:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 22, 2007, 9:03pm UTC](https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962/1 "2007-10-22T21:03:34Z")

</div>

I’ve got to write a little app at work for doctors and med students to  
view a streaming video feed, and the users want the ability to have a  
chat window. I’ve got everything else figured out, authentication, the  
stream, etc. The chat feature is something I don’t really know where  
to start on. It does not need to be nearly as fancy as Campfire. The  
only “extra” is that the chats need to be logged transcripts can be  
downloaded later. Does anyone know of a plugin that might do this? Or,  
I’d love to hear of some ideas you may have.  
Thanks.

–  
Sterling A.  
sterling\_anderson [at] [mac.com](http://mac.com)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 22, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962/2 "2007-10-22T21:45:40Z")

</div>

> The only “extra” is that the chats need to be logged transcripts can be  
> downloaded later. Does anyone know of a plugin that might do this? Or,  
> I’d love to hear of some ideas you may have.

well… i personally have not found very much in the way of chat  
plugins… so i went through and wrote my own. just to give you a heads  
up though, the most difficult part of my experience writing a chat app  
was to determine when to scroll to the bottom, and when to stay put. for  
example… if you’re chatting with someone and you want to read  
something that was said a while ago, you would scroll up. if the other  
person sends another message while you’re scrolled up, you want it to  
stay there. But if you’re at the bottom, you want it to stay at the  
bottom… (i hope that makes sense)… here’s the javascript i wrote to  
accomplish this…

this first one will keep the scroll at the bottom if it’s at the bottom,  
or it will stay put if it’s not.

function moveToBottom()  
{  
var div = document.getElementById(‘chatbox’);  
h = div.scrollHeight;  
sh = div.scrollTop;  
st = div.offsetHeight;  
difference = h - sh;  
alt = st + 50  
if (difference \> alt) {  
} else {  
div.scrollTop = h;  
}  
}

this one will just force it to the bottom… i use it when the page  
opens.

function forceToBottom()  
{  
var div = document.getElementById(‘chatbox’);  
h = div.scrollHeight;  
div.scrollTop = h;  
}

hope that may shed some light on the subject.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 15, 2007, 12:26am UTC](https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962/3 "2007-11-15T00:26:47Z")

</div>

Good call. That’s helpful.

On Oct 22, 11:45 am, Jon D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 15, 2007, 8:56am UTC](https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962/4 "2007-11-15T08:56:59Z")

</div>

> Does anyone know of a plugin that might do this? Or,  
> I’d love to hear of some ideas you may have.

Lingr ([http://www.lingr.com](http://www.lingr.com)) has a completely open API that is free for  
non-commercial use. We log everything that is uttered in a room, and  
you can access the transcripts are available on the website and through  
the API.

On the wiki you’ll also find lingr.js, a fairly complete client-side  
implementation into which you just plug your API key, and register some  
callbacks, and you’re good to go.

The developer’s wiki is at [http://wiki.lingr.com](http://wiki.lingr.com). Drop us a line if you  
need help or want more information than you find on the wiki.

- Danny  
[http://www.lingr.com/help/about#danny](http://www.lingr.com/help/about#danny)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 28, 2007, 6:34pm UTC](https://www.ruby-forum.com/t/campfire-like-chat-plugin/117962/5 "2007-11-28T18:34:17Z")

</div>

Thanks, unfortunately this is for a medical school and there is the  
slightest chance that HIPAA type info could be chatted over. Yes, the  
docs know they shouldn’t but they talk about patients via unencrypted  
email when they aren’t still too. So having chats stored on an  
external site is a no go.

On Nov 15, 1:56 am, Danny B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
