robinvdvleuten / php-nntp

Client for communicating with servers throught the Network News Transfer Protocol (NNTP) protocol.
MIT License
39 stars 12 forks source link

Article command? #12

Open Anahkiasen opened 9 years ago

Anahkiasen commented 9 years ago

I didn't find a way to get an article's contents from the package, through the ARTICLE command, is it not possible without writing my own implementation?

Anahkiasen commented 9 years ago

Ok figured out how to do it from the existing commands, actually simpler than I thought. Would be nice to have it in core though, feel like BODY and ARTICLE should be pretty common use cases

Anahkiasen commented 9 years ago

Gonna do a PR with the ARTICLE command later but it's a more complicated one.

Anahkiasen commented 9 years ago

Actually not sure about something, should an ARTICLE command just return the contents from the socket or should it clean it up in some way? On the project I use php-nntp on I have a class dedicated for that but not sure if most of it is not specific to news.php.net

robinvdvleuten commented 9 years ago

It is intended to do some small cleanups, I should check that in my own project. I extracted it at first from a project I started which indexes NZB newsgroups and the inspiration came from the Net_NNTP library (github). I want to mimic their output as close as possible so that library can be easily replaced with mine. So checkout this line to see how the output of the command should be.