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: "
\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
", 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: A list of all sources 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: " \n\n"
If the type of this thing is a menu, then
Print: "You can view an Outline of this menu \n\n"
tiserver, tiport, nodeid, tiserver, tiport, nodeid, tiserver, tiport, nodeid
Print: "Show the path to
this item from the Main Menu.
GET /worldwide-techinfo
A menu of all TechInfo servers. Remember to replace penninfo-gopher
with gopher://gopher.upenn.edu/
. If they can, then
Get node info. Print
and
Information about \"%s\"
\n",
fullsourcename, fullsourcename
Print:
Print out both short & long source name, telephone numbers, people's names,
email addresses, etc, for this source.
Print:
if tiserver is equal to local_tiserver, then
Print: Information about \"%s\"
\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: "\n"
Print: "Title: %s\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: %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: " %s\n", keyword
Print: "Nodeid: %s\n", nodeid
Print: "
\n\