Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Notelet Nodelet Squawkbox Client

created by in10se

(thing) by in10se (9.3 hr) (print)   ?   (I like it!) Wed Jul 02 2003 at 17:32:18

Notelet Nodelet Squawkbox Client

Version: 1.0 (released July 2, 2003)
Download location: http://www.pitt.edu/~rttaylor/e2/squawkboxclient.js

Note to readers: I welcome any feedback on this code - good or bad.


What is it?

Yet another Notelet Nodelet Utility.

The Notelet Nodelet Squawkbox Client is an auto-refreshing chatterbox client. Unlike many other chatterbox clients, this one works directly within E2 as opposed to running a separate application, or opening another browser window.

As the name implies, the client uses the combination of the Notelet Nodelet and the squawkbox to do all of this. A single JavaScript file "glues" these resources together. Once you have set it up, you simply navigate to the squawkbox through a link or the search box, and the script automatically starts working.


How do I set it up?

First, you need to make sure you have some hard drive or web space to save a file to. Angelfire or a similar free web service1 will do fine. You may alternately save it to your hard drive, but be aware that if you do this, you will only be able to access it from a single computer2. You then create a .js file named squawkboxclient.js and include the source code listed below (or download it from the location specified at the top of this writeup). Then just upload the file to your web site.

Next, make sure you have the Notelet Nodelet turned on. You can do this by selecting it from your User Settings under the Nodelets heading. Once you have turned it on, you should see it in the column on the right with all the other nodelets. You then add the single line of code specified below to your notelet.

You're done! Just go to squawkbox and try it out.


Source Code

The .js Code

The squawkboxclient.js file should contain the following code:

// nodetitle is case sensitive
var nodetitle = 'squawkbox';

// you can change this to whichever server you use
var e2server = 'http://everything2.com';

// feel free to remove this link to the squawkbox
document.write('<a href="/?node=squawkbox">Open the Squawkbox</a>');

// only refresh the page if the user is at the squawkbox so that
// normal E2 use is not disrupted by unwanted refreshes
if (document.title == nodetitle + '@Everything2.com')
{
    // the refresh time is in milliseconds so 1000 = 1 second
    // (i.e., 60000 = 1 minute)
    // change it as you see fit, but don't make it too low or you 
    // may overload the server
    setTimeout('refresh()', 60000);
}
	
function refresh()
{
    // don't refresh if the user is in the middle of typing a message
    if (document.forms[2].message.value == '')
        document.location.href = e2server + '/?node=' + nodetitle;
}

Notelet Nodelet Code

If you saved the .js file to a web site, go to the Nodelet Editor to add the following HTML tag:

<script type="text/javascript" src="http://www.mydomain.com/squawkboxclient.js"></script>

Where http://www.mydomain.com/squawkboxclient.js is the URL of the JavaScript file you uploaded.

If you saved the .js file to your hard drive, go to the Nodelet Editor to add the following HTML tag:

<script type="text/javascript" src="file:///c:/mydocuments/squawkboxclient.js"></script>

Where c:/mydocuments/squawkboxclient.js is the file system path of the JavaScript file you saved to your hard drive.

If you are really pressed for space in your notelet with either of these methods, you can probably leave off the type="text/javascript" attribute.


Testing it out

If you want to "try before you buy", you may enter http://www.pitt.edu/~rttaylor/e2/squawkboxclient.js for the URL in your notelet. If you like it, please download your own copy, as I don't need hundreds of requests to that server. Note that the test file uses everything2.com as the primary server, so if you typically use another server, you will be taken to http://everything2.com after the first refresh.


Words of Wisdom

Please be respectful and consciencious when using this. Do not leave your browser on the squawkbox if you are not chatting (or at least actively lurking). Do not set your refresh interval to low, or you may bog down the server.


Frequently Asked Questions

Q. Are there any compatibility issues?
A. I tested this with Mozilla 1.3, Internet Explorer 6, and Netscape 7 and found no problems. Please let me know if this does not work with your browser, and I'll see what I can do.

Q. If it refreshes on a timer, won't that cause it to sometimes refresh while I'm in the middle of typing a message?
A. No. The script checks to see if there is any text in the message field before refreshing. If so, it stops, and it is then up to you to press Talk.

Q. I am a super elite uber-god content editor edevite, so have plenty of room in my notelet for your entire source code, but when I tried it, it didn't work. Why?
A. The source code references the document forms array through the use of square brackets ([ ]). Obviously this is how hard links are made, so it gets messed up. If anyone knows how to get around this, I'd love to hear it.

Q. Will you add Feature X to your client?
A. Maybe. Feel free to send me RFEs.

Q. Why?
A. Because.


1 Apparently it doesn't work from GeoCities.
2 Thanks m_turner for this idea.


printable version
chaos

chatterbox client E2 Annotation Tool Notelet nodelet utility for reading ROT-13 text E2 Explorer
Notelet nodelet utility for following external links in the chatterbox E2 Link and Logger Client Notelet nodelet utilities E2 Message Inbox Archiver
HTML attributes E2 Lag Reduction Suggestions for Noders Catbox - Windows chatter client KB
PHP E2 chatterbox XML ticker parser HTML tags frogbox Notelet nodelet HTML tricks
URL escape sequences Notelet nodelet utility for displaying pipe links RFE Notelet Nodelet Chatterbox Client
Mattbox: Mac OS X Chatterbox Client E2 HTML A Game of Tag How to calculate the day of the week for a given date
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 to live by:
There are no seasons in California
Islam
HOT DAMN!: Drinking, Debauchery, and Dastardly Deeds
The biggest dose of LSD ever
The Rose Center for Earth and Space
A Long Week Turning Thirty
Real war: Civilization threatened!
Sei Shonagon
When the Sun Rises
Muhammad Ali
Mikhail Khodorkovsky
Excerpts from a letter to President Pierce from Chief Seattle
Red Hat To Buy Microsoft
New Writeups
BookReader
Fear the Cold(dream)
Pavlovna
Kathleen MacInnes(person)
stainedglass
1(fiction)
kalen
Three "T"s(idea)
octillion369
Undead(idea)
archiewood
Ico(fiction)
Heisenberg
Why I love Everything2(log)
octillion369
Death Knight(person)
XWiz
Are you hoping for a miracle?(review)
santo
The Host(review)
LostPsion
"Shut the Fuck Up" Theaters(idea)
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)
E2 is a by-product of the existence of The Everything Development Company