For all of the following, first connect to [tihost] at [tiport], get past the connection banner, and send the v: and O: transactions(any others?), etc. GET /[tihost]:[tiport]/M/[tinodeid] Algorithm for sending a menu html document: Use techinfo transaction (s: ???) to get node information. Need the Title, the short source and full source names. Make this a subroutine because it'll be called a lot. Print out the title twice: "%s\n

%s

", doctitle, doctitle Print Print: "The source of this menu is %s.\n\ More information is available about this menu.

\n", tiserver, tiport, shortsource, longsource, tiserver, tiport, tinodeid. Send the list of menu items. Use techinfo transaction w:2:[tinodeid]:1 to get all of the items in this menu. See below for how to deal with each item. Print: "Return to the Main Menu<\a> at %s.\n" tiserver, tiport, tiserver. How to send a LIST OF ITEMS (either for search or menu expansion): Print: "To see the size or other information each item below, follow the \"Info\" link.\n" Print: "

\n"

		For each menu item from the w: or searching transaction:
		    Figure out the type, nodeid, and title of the item

		    Figure out the number of levels deep this item is

		    Print a single line:
		    %*s%s    Info\n
		    %s:%s		tiserver, tiport
		    %c		I, D, or M
		    %s		the nodeid of the child
		    %s		If type is I, then ".gif", else "".
		    %*s		numlevels * indentlen, ""
		    %s		Title of the child
        %s:%s		tiserver, tiport
		    %s		the nodeid of the child

		Print 
at the end of the list of menu items. GET /[tihost]:[tiport]/D/[tinodeid] Algorithm for sending an ascii text html document: Get node information -- use the same subroutine as for getting menu info. Need the Title, the short source and full source names. Print: "%s\n

%s

", doctitle, doctitle Print: "The source of this document is %s.\n\ More information is available about this document.

\n", tiserver, tiport, shortsource, longsource, tiserver, tiport, tinodeid. Print:

Use the t: transaction to get the text of the document, and then send it verbatim. Is a terminator necessary? GET /[tihost]:[tiport]/I/[tinodeid].gif Algorithm for sending a GIF image: Figure out if WWW images can have html at the beginning of them. Such as: <title> or <h1>. If they can, then Get node info. Print <title> and <h1> and <isindex> Use the t: transaction to get the 8-bit contents of the document, and send them verbatim. GET /[tihost]:[tiport]/[type]/[tinodeid]?[word]+[word] Results of a search. Not yet certain how this works. GET /[tihost]:[tiport]/source/[sourcename] Detailed contact information about the short sourcename. Use techinfo transaction (???) to get all informaton about the sourcename. Print: "<Title>Information about \"%s\"<\title>\n\ <H1>Information about \"%s\"</h1>\n", fullsourcename, fullsourcename Print: <pre> Print out both short & long source name, telephone numbers, people's names, email addresses, etc, for this source. Print: </pre> if tiserver is equal to local_tiserver, then Print: <p>A list of <a href=\"/%s:%s/D/%s\">all sources</a> is available.\n", local_ti_sources_nodeid GET /[tihost]:[tiport]/info/[tinodeid] Detailed information about the document, menu, or image. Get the node information -- use the same subroutine as for a menu or plain text document. Print: "<Title>Information about \"%s\"</title>\n\ <H1>Information about \"%s\"</h1>\n\n", title, title. If this node is a plain ascii text or image document, then use the t:[nodeid]:0:20 transaction to get the total # of bytes and the last modification date of the file. Print: "<pre>\n" Print: "Title: <a href=\"/%s:%s/%c/%s%s\">%s</a>\n tiserver, tiport, itype, nodeid, ".gif" or "", title If the itype is D or I, then If the totalbytes is < 2048 then Print: "Size: %d bytes.\n", totalbytes else Print: "Size: %dK bytes.\n", totalbytes/1024 Print: "Modified: %s\n", lastmodtime Print: "Source: <a href=\"/%s:%s/source/%s\">%s\n tiserver, tiport, shortsource, longsource Print: "Type: %s\n", Switch (itype), "Menu", "Plain text", "Image". Print: "Keywords:\n" For each keyword on the keyword list (separated by commas): Print: " <a href=\"unimplemented\">%s</a>\n", keyword Print: "Nodeid: %s\n", nodeid Print: "</pre> <p>\n\n" If the type of this thing is a menu, then Print: "You can view an Outline of this menu <ul>\n\ <li><a href=\"/%s:%s/outline/2/%s\">two levels deep</a>,\n\ <li><a href=\"/%s:%s/outline/3/%s\">three levels deep</a>, or\n\ <li><a href=\"/%s:%s/outline/4/%s\">four levels deep</a>.</ul> <p>\n\n" tiserver, tiport, nodeid, tiserver, tiport, nodeid, tiserver, tiport, nodeid Print: "Show the <a href="/%s:%s/path/%s">path</a> to this item from the <a href=\"/%s:%s/M/0\">Main Menu</a>. GET /worldwide-techinfo A menu of all TechInfo servers. Remember to replace penninfo-gopher with gopher://gopher.upenn.edu/