Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the trivial-nntp Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 06:03:53 2022 GMT+0.
Next: Systems, Previous: The trivial-nntp Reference Manual, Up: The trivial-nntp Reference Manual [Contents][Index]
Common lisp tools for connecting to and crawling around NNTP servers. It uses usocket and cl+ssl, and therefore handles simple or SSL-encrypted NNTP connections.
This is a minimalistic effort; however watch this:
CL-USER> (in-package :tnntp)
TNNTP> (command "HELP")
"100 Legal commands^M"
1
TNNTP> (rlist)
" ARTICLE [message-ID|number]^M"
" AUTHINFO USER name|PASS password|GENERIC program [argument ...]^M"
" BODY [message-ID|number]^M" " CAPABILITIES [keyword]^M"
" COMPRESS DEFLATE^M" " DATE^M" " GROUP newsgroup^M"
"..."
"Report problems to <usenet@fleegle.mixmin.net>.^M"
TNNTP> (disconnect)
"205 Bye!^M"
2
CL-USER>
This simple test connect to news.mixmin.net (see tnntp.lisp). To connect to your server, create a server just like this (with your own info, of course):
(defparameter *server* ;; or keep this in some other place...
(make-server :name "news.mixmin.net"
:port 119
:user nil
:password nil
:ssl nil
)
(defparameter *conn* ;; or create an array of connections or whatever
(make-conn :server *server* :group "alt.whatever")
At the core, the server structure (see 'tnntp.lisp') contains information about the URL, port, authentication. A connection keeps track of the socket/stream state. The system will transparently reconnect and restore current group on a connection should the server close the connection.
Commands are sent with something like (command connection "commandstring" :expecting 2 ) The expecting parameter, if specified, makes sure that the response in in 200-299 range (only first digit is checked). For commands with an additional parameter such as "GROUP groupname" the :also parameter avoids building command strings: (send-command "GROUP" :also groupname)
Responses are read with
Lines are returned unprocessed, with control-M character. Rationale: you will probably parse the lines anyway, so there is little reason to worry about that.
WORKFLOW
A SIMPLE EXAMPLE
(load-groups)
(search-groups "book")
Search the grouplist for anything containing the word 'book'; regex expressions allowed!
References: *
Next: Files, Previous: Introduction, Up: The trivial-nntp Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Simple tools for interfacing to NNTP servers
Stacksmith <fpgasm@apple2.x10.mx>
MIT
Next: Packages, Previous: Systems, Up: The trivial-nntp Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: trivial-nntp/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
trivial-nntp (system).
Next: trivial-nntp/tnntp.lisp, Previous: trivial-nntp/trivial-nntp.asd, Up: Lisp [Contents][Index]
trivial-nntp (system).
Previous: trivial-nntp/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
trivial-nntp (system).
Next: Definitions, Previous: Files, Up: The trivial-nntp Reference Manual [Contents][Index]
Packages are listed by definition order.
tnntp
common-lisp.
Next: Indexes, Previous: Packages, Up: The trivial-nntp Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Public Interface, Up: Public Interface [Contents][Index]
Next: Standalone methods, Previous: Special variables, Up: Public Interface [Contents][Index]
send an NNTP command and read response. Return first digit of response and entire response string.
- (commnad "XOVER" :also (range 1 10))
- (command "GROUP" :also "alt.blah.blah.blah"
cleanly disconnect from the server
output an NNTP article range to stream.
Reconnect to the server, if disconnected, restoring state (entering a group). This needs more work...
return a unit (line) of text or nil for NNTP endline
collect a list containing lines of data, processing if requested
name.
port.
ssl.
user.
Next: Conditions, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
Next: Structures, Previous: Standalone methods, Up: Public Interface [Contents][Index]
Previous: Conditions, Up: Public Interface [Contents][Index]
structure-object.
119
1
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Generic functions, Previous: Internals, Up: Internals [Contents][Index]
return nil for NNTP endline
return first digit of the code and the entire line
Previous: Ordinary functions, Up: Internals [Contents][Index]
id.
Previous: Definitions, Up: The trivial-nntp Reference Manual [Contents][Index]
Jump to: | (
C D F G L M N P R S |
---|
Jump to: | (
C D F G L M N P R S |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | *
B G I M N P S U |
---|
Jump to: | *
B G I M N P S U |
---|
Jump to: | C F N P S T |
---|
Jump to: | C F N P S T |
---|