Nothing has been indexed for 0.1.5 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  nntp-client:
    github: spoved/nntp-client.cr
    version: ~> 0.1.5

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.1.5. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

nntp-client

A NNTP (Network News Transfer Protocol) client aimed to provide a more useful interface to the nntp-lib

Installation

  1. Add the dependency to your shard.yml:
    dependencies:
      nntp-client:
        github: spoved/nntp-client.cr
  2. Run shards install

Usage

require "nntp-client"

client = NNTP::Client.connect(
  host: ENV["USENET_HOST"],
  port: ENV["USENET_PORT"].to_i,
  user: ENV["USENET_USER"],
  secret: ENV["USENET_PASS"], method: :original
)

# Search for the article num of this post
client.find_article_num(
  message_id: "1359110409.83725.1@reader.easyusenet.nl",
  group: "alt.binaries.tun",
  batch_size: 2000,
  offset: 1958260_i64
) # => 1958270

# Fetch article headers
client.with_group "alt.binaries.tun" do
  client.headers(1958270) # => {num: 1958270, id: "1359110409.83725.1@reader.easyusenet.nl", headers: {"Path" => "not-for-mail", "From" => "lori256 <lori256@isiinheaven.net>", "Newsgroups" => "alt.binaries.tun", "Subject" => "2kGiFqHLaYfIBPbtk1CPsDsdDJubu4[1/5] - \"PbtdX885Fs5QvhcwY2Wo-thumb.jpg\" yEnc (1/1)", "Message-ID" => "<1359110409.83725.1@reader.easyusenet.nl>", "X-Newsposter" => "newsmangler 0.03 (yenc-fred) - http://www.madcowdisease.org/mcd/newsmangler", "Date" => "25 Jan 2013 10:39:23 GMT", "Lines" => "424", "Organization" => "easyusenet", "X-Received-Bytes" => "55537"}}
end

See spec tests for examples.

Contributing

  1. Fork it (https://github.com/spoved/nntp-client.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