https://github.com/robinvdvleuten/php-nntp
Client for communicating with servers throught the Network News Transfer Protocol (NNTP) protocol.
https://github.com/robinvdvleuten/php-nntp
nntp php
Last synced: about 1 year ago
JSON representation
Client for communicating with servers throught the Network News Transfer Protocol (NNTP) protocol.
- Host: GitHub
- URL: https://github.com/robinvdvleuten/php-nntp
- Owner: robinvdvleuten
- License: mit
- Created: 2013-11-17T11:26:49.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-02-06T22:51:43.000Z (over 7 years ago)
- Last Synced: 2025-03-27T01:02:52.550Z (about 1 year ago)
- Topics: nntp, php
- Language: PHP
- Homepage:
- Size: 229 KB
- Stars: 39
- Watchers: 10
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NNTP
Client for communicating with servers throught the Network News Transfer Protocol (NNTP) protocol.
[](https://packagist.org/packages/rvdv/nntp)
[](https://travis-ci.org/robinvdvleuten/php-nntp)
[](https://scrutinizer-ci.com/g/robinvdvleuten/php-nntp/?branch=master)
[](https://scrutinizer-ci.com/g/robinvdvleuten/php-nntp/?branch=master)
[](https://styleci.io/repos/14465626)
## Installation
The recommended way to install the library is [through composer](http://getcomposer.org).
```bash
composer require rvdv/nntp:^0.9.0
```
## NNTP?
> NNTP specifies a protocol for the distribution, inquiry, retrieval,
> and posting of news articles using a reliable stream (such as TCP)
> server-client model. NNTP is designed so that news articles need only
> be stored on one (presumably central) host, and subscribers on other
> hosts attached to the LAN may read news articles using stream
> connections to the news host.
> -- RFC Abstract ([source](http://tools.ietf.org/html/rfc977))
## Usage
Here is an example that fetches 100 articles from the _php.doc_ of the _news.php.net_ server:
```php
connect();
$overviewFormat = $client->overviewFormat();
$group = $client->group('php.doc');
$articles = $client->xover($group['first'], $group['first'] + 100, $overviewFormat);
// Process the articles further...
$client->disconnect();
```
## Tests
To run the test suite, you need install the dependencies via composer, then run PHPUnit.
```bash
$ composer install
$ php vendor/bin/phpunit
```
## License
MIT © [Robin van der Vleuten](https://www.robinvdvleuten.nl)