|
|||||||||
|
Scout technical referenceIntroductionThe Scout interface allows webmasters and users to insert live room information on their web pages.In the current implementation, Scout is served from an HTTP server. Thus, web clients and other web servers can easily connect to the service and parse the output.
Each Scout request has two key elements, the
Any room is eligible for Scout service. The currently defined
Scout data is updated every five minutes. Constants and conventionsThe query interface base address ishttp://scout1.ufs.liveharmony.org/scout/scout
The utility script (useful only with
Use
The current version is InterfacesTwo interfaces are available: a raw interface and a JavaScript based interface. The raw interface is designed for server-side applications; the JavaScript interface is designed for web browsers.Raw interfaceThe server will output a raw, unescaped version of the data requested. It can be accessed by any HTTP-compatible interface such as PHP'sfile_get_contents().
The returned string is not HTML-escaped; inserting it directly into a page may create a cross-site scripting vulnerability. Use a suitable escaping function such as PHP's JavaScript interfaceAll scripts are loaded with<script src="scout_request_url" language="JavaScript" type="text/javascript">.
Webmasters wishing to use the JavaScript interface must first load the utility script. For each request, the server will output a JavaScript (automatically loaded immediately) that "registers" a piece of data. From that point on, the data returned are available to the rest of the page. After loading the utility script, the following functions are available: lh_scout_insert_here(channel, op)Inserts an HTML-escaped version of the data at the current point in the document. Usesdocument.write().
lh_scout_insert_container(channel, op, id)Inserts an HTML-escaped version of the data in a container element (e.g.<div> or <span>; see W3C's HTML 4.0 recommendation) specified by id. Does not work with Netscape 4.
lh_scout_get_raw(channel, op)Returns a string of the data, suitable for use in JavaScript. The returned string is not HTML-escaped; inserting it directly into a page may create a cross-site scripting vulnerability. Uselh_scout_get_html() for an HTML-escaped version.
lh_scout_get_html(channel, op)Returns a string of the data, suitable for use in HTML. The returned string is HTML-escaped. Uselh_scout_get_raw() for a raw version.
lh_scout_tohtml(str)Returns an HTML-escaped version ofstr.
Notes
Sample applicationsUser informationA webmaster could insert the current user count in his web page. Users would not have to waste time opening the chat room only to see that others were not active. (Note that this application could lead to a chicken-egg problem in which no user wants to enter the room because no other user is in the room; webmasters could use scheduled chats to work around this problem.)Room statisticsA webmaster could use the raw interface to collect user counts from various times during a day to determine peak times.Notes
Possible future enhancementsRoughly in order of priority:
|
||||||||
|
liveHarmony is sponsored by linkLINE Communications
linkLINE offers nationwide dial-up, DSL, frame relay, web hosting and co-location |
|||||||||
| Contact us |
Learn about chat room safety © 2002-2008 liveHarmony. Portions of this work are licensed under a Creative Commons license |
||||||||