module NNTP::Connection::Articles

Direct including types

Defined in:

nntp/connection/articles.cr

Instance Method Summary

Instance Method Detail

def body(num : Int32 | Int64) : Array(String) #

Will return an Array(String) that is the article's body text.


[View source]
def body(message_id : String) : Array(String) #

Will return an Array(String) that is the article's body text.


[View source]
def headers(num : Int32 | Int64) #

Will return a Header tuple with the fetched article information.

client.with_group "alt.binaries.cbt" do
  client.headers 56910000 # => {num: 56910000, id: "YwGnYrShOtJaBfSzZlTkKbBh-1587103108703@nyuu", headers: {"Organization" => "Usenet.Farm", "Message-Id" => "<YwGnYrShOtJaBfSzZlTkKbBh-1587103108703@nyuu>", "User-Agent" => "Nyuu/0.3.8", "X-Ufhash" => "lHibuaCxtuuI3C4ugIWhcSBuWhY%2B2Wu5sbzIanIMroeK4nRzeUWbUwFaNNhD7Tot6%2FKfcwbvXWhI9Am82VQ%2BKph5IYQ8NMOUARHaXY8LlmDbOnmGi8qNLxh0IocmkVeY04Cfy2trF4cEtuV3wP1kSR7IfuJV3UPO9ORwOFvlZtOe6CwX16D%2BKM1%2B%2FBcetDZIGZapQoDQIhngZNENi5cRFlWbmy3CEqwpMsm8", "Date" => "Fri, 17 Apr 20 05:58:28 UTC", "Path" => "not-for-mail", "Subject" => "[170/170] - \"2CDrmrC36H47j0n1f.part161.rar\" yEnc (186/214) 153066646", "From" => "3vq60fEnli <[email protected]>", "Newsgroups" => "alt.binaries.bungalow,alt.binaries.downunder,alt.binaries.flowed,alt.binaries.cbt,alt.binaries.test, alt.binaries.boneless,alt.binaries.iso", "X-Received-Bytes" => "740517", "X-Received-Body-CRC" => "3585757165"}}
end

[View source]
def headers(message_id : String) #

See #headers(num : Int32 | Int64). Note: Using the message_id instead of article num will return a article num of 0.

client.with_group "alt.binaries.cbt" do
  client.headers "YwGnYrShOtJaBfSzZlTkKbBh-1587103108703@nyuu" # => {num: 0, id: "YwGnYrShOtJaBfSzZlTkKbBh-1587103108703@nyuu", headers: {"Organization" => "Usenet.Farm", "Message-Id" => "<YwGnYrShOtJaBfSzZlTkKbBh-1587103108703@nyuu>", "User-Agent" => "Nyuu/0.3.8", "X-Ufhash" => "lHibuaCxtuuI3C4ugIWhcSBuWhY%2B2Wu5sbzIanIMroeK4nRzeUWbUwFaNNhD7Tot6%2FKfcwbvXWhI9Am82VQ%2BKph5IYQ8NMOUARHaXY8LlmDbOnmGi8qNLxh0IocmkVeY04Cfy2trF4cEtuV3wP1kSR7IfuJV3UPO9ORwOFvlZtOe6CwX16D%2BKM1%2B%2FBcetDZIGZapQoDQIhngZNENi5cRFlWbmy3CEqwpMsm8", "Date" => "Fri, 17 Apr 20 05:58:28 UTC", "Path" => "not-for-mail", "Subject" => "[170/170] - \"2CDrmrC36H47j0n1f.part161.rar\" yEnc (186/214) 153066646", "From" => "3vq60fEnli <[email protected]>", "Newsgroups" => "alt.binaries.bungalow,alt.binaries.downunder,alt.binaries.flowed,alt.binaries.cbt,alt.binaries.test, alt.binaries.boneless,alt.binaries.iso", "X-Received-Bytes" => "740517", "X-Received-Body-CRC" => "3585757165"}}
end

[View source]
def last #

[View source]
def next #

[View source]
def with_article(num : Int32 | Int64, &) #

Will set the current article to provided num and yield self to provided block

client.with_group("alt.binaries.cbt") do
  client.with_article(56910000) do
    # Perform actions within the context of group alt.binaries.cbt and with article #56910000
  end
end

[View source]
def xheader(header, message_id : String | Nil = nil) #

[View source]
def xheader(header, num : Int64 | Int32, end_num : Int64 | Int32 | Nil = nil, all : Bool = false) #

[View source]
def xover(num : Int64 | Int32, end_num : Int64 | Int32 | Nil = nil, all : Bool = false) #

[View source]