ruby-net-nntp
by Anton Bangratz <[email protected]>

== DESCRIPTION

The Net::NNTP library provides a simple communication layer for the NNTP (Network News Transfer Protocol).

== FEATURES

The Net::NNTP library provides a communication layer in Net::HTTP style for NNTP.


== SYNOPSIS

Net::NNTP uses a simple interface to wrap commands to communicate with an NNTP server.

=== Example

nntp = Net::NNTP.new
nntp.server = 'localhost' # also default
nntp.port = 119 # default port
welcome = nntp.connect
if OKResponse === welcome
# set mode reader
request = Net::NNTP::Modereader
response = nntp.process(request)
if PostingAllowed === response
File.open('message', r) {|f|
request = Net::NNTP::Post
request.body = f
response = nntp.process(request)
case response
when ArticleReceived
#everything ok, go on ..
when PostingNotPermitted
# inform user
when PostingFailed
# delay and retry?
...
response = nntp.process(nntp.last_response.request)
end
}
end
end



== INSTALL

* sudo gem install ruby-net-nntp or
* sudo dpkg -r libruby-nntp_1.0.0_all.deb

= CHANGES


Version 0.2.x introduces a more complete API and bugfixes.

Version 0.1.0 introduces the Net::NNTP::Article#headers and #body attributes.
Due to this, the attribute Net::NNTP::Article#id has been changed to Net::NNTP::Article#number
to avoid conflicts with Object#id.

Additionally, on request, Net::NNTP::Article has been changed from being a mere proxy for Net::NNTP#xover
result lines to being able to parse HEAD, BODY and ARTICLE results and return a corresponding instance.

== Acknowledgments

Thanks to Ward Bekker and Geff Hanoian for finding and fixing bugs and providing me with useful hints and enhancements.
Thanks to Jürgen Strobel for providing support and hosting of the code libraries and bug tracking system. Thanks to Tom
Copeland and Rich Kilmer for rubyforge, and big thanks to Matz and everyone of the core team for Ruby.