Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Notelet Nodelet Chatterbox Client

created by Anml4ixoye

(thing) by Anml4ixoye (3 wk) (print)   ?   (I like it!) Thu Apr 03 2003 at 19:10:22

Current Version: 0.35
Last Updated: 4/3/2003 21:25 server time

Hello, and welcome to the Notelet Nodelet Chatterbox Client. This project's goal is to provide a button in your notelet nodelet that will allow you access to a dynamic chatterbox that refreshes every 30 seconds.

How is this different from other chatterbox clients? - Because you are calling it from the everything2 site, there are no user authentication issues. Of course, right now you can't submit messages, but once that is functional it will not require you to go to an untrusted third party.

What do I need to run this? - The current version is functioning in IE 5.5 and above. I have run some basic tests using Phoenix 0.4 and Mozilla 1.2, but those are not supported in this release.

For you IE users: This calls an ActiveX component to do the parsing. You may need to download the MSXML SDK at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm/sdk_intro_6g53.asp. Mozilla has the parsing built in natively, so it won't need anything special at all.

How do I get this working?! - Because of the limited amount of space in the notelet nodelet, especially for lower level noders, I suggest copying the code into a .js file and hosting it somewhere you trust, then importing that. You are more than welcome to use the script below as is, I will try hard not to change the .js file I am hosting without testing it first.

I can't get it to work! - Please remember that this is Alpha quality code. If it doesn't work for you please /msg me with your browser (IE), version (5.5) and platform (Windows 98, Mac) and I will do my best to find out what is going on.

The notelet nodelet code:


<script language="javascript" src="http://www.cornetdesign.com/chatterbox.js">
</script>
<form><input type="button" value="Chatterbox" 
onClick="javascript:callChatterbox()"><form>


(Note: you may have to remove the line breaks from the above code)

The .js code

This code takes advantage of the capabilities of newer browsers to parse the DOM of XML structures. By hitting the Universal Message XML Ticker, then parsing that, we get the messages. It also helps reduce server load. Yea!

This is an early release of the code, so it may change. However, the latest "stable code" (we are talking Javascript here) will be available in a .js file at http://www.cornetdesign.com/chatterbox.js

If you have suggestions, concerns, complaints, etc, please /msg them to me. kThanx.

Things I know are missing - lessee, pipelinks, handling of /me, the fact that it is in a textarea box, ability to submit messages. Let me know if you have a feature or bug request not on this list.


Revision History:
0.35 - Combined the timer script and chatterbox to one window. Added start and close buttons.



//Global Window Handler
var vWin;

//temp browser switch. This needs to be 
//determined at run-time
ie = true;

function callChatterbox(){
	openWindow();
}

function init(){
	loadAndParseXML();
}

function loadAndParseXML(){
	var oResponseXML;
	
	oDoc = document;
	
	if(ie){
	//get the XML
	oResponseXML = loadXMLIE();
	
	
	//the start of the msglist is defined here
	msgListNode = oResponseXML.firstChild.nextSibling.firstChild.nextSibling.nextSibling;
	
	//clear out the textarea box
	oDoc.messages.msgs.value = "";
	
	while(msgListNode.hasChildNodes()){
		posterName = msgListNode.lastChild.firstChild.firstChild.firstChild.nodeValue;
		posterText = msgListNode.lastChild.firstChild.nextSibling.firstChild.nodeValue;
		oDoc.messages.msgs.value += posterName+" - "+posterText+"\n\n";
		msgListNode.removeChild(msgListNode.lastChild);
	}

	}else{
	alert("Moz!");
	}
	
	//Set this to refresh every 30 seconds
	window.setTimeout("loadAndParseXML()", "30000");
}


function loadXMLIE(){
	var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    xmlhttp.open("GET", "http://www.everything2.com/index.pl?" + 
		"node=Universal%20Message%20XML%20Ticker", false);
	xmlhttp.Send();
	oResponse = xmlhttp.responseXML;
    return oResponse;
}

function openWindow(){
	var winProps, winURL;
	
	winProps = "width=450,height=250,resizable=yes," + 
		"scrollbars=yes,menubar=yes,status=yes";
	vWin = open("", "", winProps);
	
	oDoc = vWin.document;
	
	//Set up the form
	oDoc.writeln("<h3>Chatterbox</h3>");
	oDoc.writeln("<form name=\"messages\">");
	oDoc.writeln("<textarea rows=\"10\" cols=\"45\" name=\"msgs\">");
	oDoc.writeln("Press start to begin");
	oDoc.writeln("</textarea><br><input type='button' value='start'" + 
               " onClick='javascript:init()'><input type='button' value='close'" + 
                " onClick='javascript:self.close()'></form>");
	oDoc.writeln("<script language='javascript' " + 
		"src='http:\/\/www.cornetdesign.com\/chatterbox_test.js'><\/script>");
	vWin.init();
	
	if(vWin.closed){
		return false;
	}else{
		return true;
	}
}


printable version
chaos

E2 Explorer How to start a chatterbox message with / Notelet nodelet utilities Why the chatterbox is not IRC
Notelet Nodelet Squawkbox Client PHP E2 chatterbox XML ticker parser E2 Catbox Enhancer Notelet nodelet utility for following external links in the chatterbox
E2 Chatterbox Archive It is the very model of a modern E2 chatterbox Sufjan Stevens TinyMCE
E2 Flash Chatterbox Client Thin client E2 Annotation Tool Notelet nodelet HTML tricks
Mummification Chatterbox Captain Jack Phoenix
Catch Notelet edev: XML, the catbox, and you XML parser
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes your grandpa would have liked:
The Complete Works of Lewis Carroll
Gargouille
Everything Quests: Games and Distractions
Winemaking
How to tenderize an octopus
bow
Choosing to be gay
Danzayémon, Chief of the Etas
William Walker
Breastfeeding
Pict
Alcoholism
Heroes of Destiny
New Writeups
XWiz
Are you hoping for a miracle?(review)
santo
The Host(review)
LostPsion
"Shut the Fuck Up" Theaters(idea)
Vanish
The line between normal and not(place)
Vanish
insanity(thing)
beatrice
You've been slowly taking me over for nearly a year, do you know that?(idea)
Berek
YouTube(thing)
shaogo
How to Pretend to Have a Job(idea)
hapax
Les Provinciales(review)
zoeb
The Scene(review)
aneurin
Telephone Numbers for drama purposes(idea)
Alnilamski
Cosmicopolis(fiction)
eien_meru
measure(idea)
Dreamvirus
pussy willow(thing)
czeano
Three "T"s(idea)
This affordable entertainment brought to you by The Everything Development Company