nntp-lib

Build Status Release Status Latest release

This is a pure Crystal source (single file, fully documented) code, provides a minimum requisite functions for NNTP (Network News Transfer Protocol) clients, per RFC977, extensions RFC2980 and authentication DRAFT.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      nntp-lib:
        github: spoved/nntp-lib.cr
  2. Run shards install

Usage

The NNTP socket can be established via the start method which yields itself to the provided block.

require "nntp-lib"

nntp = Net::NNTP.new("secure.usenetserver.com", 563)
nntp.start(user: "myuser", secret: "pass", :original) do |socket|
  # Perform nntp requests here
end

The socket can also be started without a block, but finish should be called to close the nntp session.

require "nntp-lib"

nntp = Net::NNTP.new("secure.usenetserver.com", 563)
nntp.start(user: "myuser", secret: "pass", :original)

# Perform nntp requests here

nntp.finish

Missing Features

Contributing

  1. Fork it (https://github.com/spoved/nntp-lib.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors