2017 © Pedro Peláez
 

library react-nntp

Network News Transfer Protocol (NNTP) bindings for React.

image

rvdv/react-nntp

Network News Transfer Protocol (NNTP) bindings for React.

  • Friday, January 10, 2014
  • by robinvdvleuten
  • Repository
  • 1 Watchers
  • 1 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 3 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

NNTP Component

Network News Transfer Protocol (NNTP) bindings for React. This component builds on top of the SocketClient component to implement NNTP., (*1)

Latest Stable Version Total Downloads Latest Unstable Version Build Status Coverage Status SensioLabsInsight, (*2)

Install

The recommended way to install react-nntp is through composer., (*3)

{
    "require": {
        "rvdv/react-nntp": "1.0.*@dev"
    }
}

Basic Usage

Here is a simple example that fetches the first 100 articles from the 'php.doc' newsgroup of the PHP mailing list., (*4)


use React\Dns\Resolver\Factory as ResolverFactory; use React\EventLoop\Factory as EventLoopFactory; use Rvdv\React\Nntp\Client; use Rvdv\React\Nntp\Command\CommandInterface; use Rvdv\React\Nntp\Response\ResponseInterface; $loop = EventLoopFactory::create(); $dnsResolverFactory = new ResolverFactory(); $dns = $dnsResolverFactory->createCached('8.8.8.8', $loop); $client = Client::factory($loop, $dns); $group = null; $format = null; $client ->connect('news.php.net', 119) ->then(function (ResponseInterface $response) use ($client) { return $client->overviewFormat(); }) ->then(function (CommandInterface $command) use (&$format, $client) { $format = $command->getResult(); return $client->group('php.doc'); }) ->then(function (CommandInterface $command) use (&$group, &$format, $client) { $group = $command->getResult(); return $client->overview($group->getFirst() . '-' . ($group->getFirst() + 99), $format); }) ->then(function (CommandInterface $command) use ($client) { $articles = $command->getResult(); // Process the articles further. $client->stop(); }); $client->run();

Tests

To run the test suite, you need PHPUnit., (*5)

$ phpunit

Vagrant

You can also use the configured Vagrant VM for local development. Move into the /vagrant directory and run the following commands;, (*6)

# Resolve the Puppet dependencies through librarian-puppet.
$ gem install librarian-puppet
$ librarian-puppet install

$ vagrant up

The Versions

10/01 2014

dev-master

9999999-dev

Network News Transfer Protocol (NNTP) bindings for React.

  Sources   Download

MIT

The Requires

 

The Development Requires