Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the trivial-nntp Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:41:59 2018 GMT+0.
• Introduction: | What trivial-nntp is all about | |
• Systems: | The systems documentation | |
• Files: | The files documentation | |
• Packages: | The packages documentation | |
• Definitions: | The symbols documentation | |
• Indexes: | Concepts, functions, variables and data types |
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: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The trivial-nntp system: |
Stacksmith <fpgasm@apple2.x10.mx>
MIT
Simple tools for interfacing to NNTP servers
trivial-nntp.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files: |
• The trivial-nntp.asd file: | ||
• The trivial-nntp/package.lisp file: | ||
• The trivial-nntp/tnntp.lisp file: |
Next: The trivial-nntp/package<dot>lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
trivial-nntp.asd
trivial-nntp (system)
Next: The trivial-nntp/tnntp<dot>lisp file, Previous: The trivial-nntp<dot>asd file, Up: Lisp files [Contents][Index]
trivial-nntp (system)
package.lisp
Previous: The trivial-nntp/package<dot>lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
trivial-nntp (system)
tnntp.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The trivial-nntp package: |
package.lisp (file)
tnntp
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions: | ||
• Internal definitions: |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables: | ||
• Exported functions: | ||
• Exported conditions: | ||
• Exported structures: |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
tnntp.lisp (file)
tnntp.lisp (file)
Next: Exported conditions, Previous: Exported special variables, Up: Exported definitions [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"
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
cleanly disconnect from the server
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
output an NNTP article range to stream.
tnntp.lisp (file)
Reconnect to the server, if disconnected, restoring state (entering a group). This needs more work...
tnntp.lisp (file)
return a unit (line) of text or nil for NNTP endline
tnntp.lisp (file)
collect a list containing lines of data, processing if requested
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
Next: Exported structures, Previous: Exported functions, Up: Exported definitions [Contents][Index]
tnntp.lisp (file)
error (condition)
text message indicating nntp error
:message
(quote nil)
nntp-error-message (generic function)
(setf nntp-error-message) (generic function)
:id
(quote nil)
nntp-id (generic function)
(setf nntp-id) (generic function)
Previous: Exported conditions, Up: Exported definitions [Contents][Index]
tnntp.lisp (file)
structure-object (structure)
conn-server (function)
(setf conn-server) (function)
conn-group (function)
(setf conn-group) (function)
0
conn-stream (function)
(setf conn-stream) (function)
0
conn-bytes-read (function)
(setf conn-bytes-read) (function)
tnntp.lisp (file)
structure-object (structure)
print-object (method)
server-name (function)
(setf server-name) (function)
119
server-port (function)
(setf server-port) (function)
server-user (function)
(setf server-user) (function)
server-password (function)
(setf server-password) (function)
server-ssl (function)
(setf server-ssl) (function)
server-groups (function)
(setf server-groups) (function)
1
server-maxconns (function)
(setf server-maxconns) (function)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions: | ||
• Internal generic functions: |
Next: Internal generic functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
return nil for NNTP endline
tnntp.lisp (file)
return first digit of the code and the entire line
tnntp.lisp (file)
tnntp.lisp (file)
tnntp.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
tnntp.lisp (file)
tnntp.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index: | ||
• Function index: | ||
• Variable index: | ||
• Data type index: |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L T |
---|
Jump to: | F L T |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | (
C D F G L M N R S |
---|
Jump to: | (
C D F G L M N R S |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
B G I M N P S U |
---|
Jump to: | *
B G I M N P S U |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C N P S T |
---|
Jump to: | C N P S T |
---|