Using sockets in PHP : Get articles from Usenet
Closing the connection
To end the session with the NNTP server, just close the socket using fclose() as you would close a file.
<?php// close connexion fclose($usenet_handle); ?>
More informatin about fclose() : http://www.php.net/manual/function.fclose.php
We just saw how to open, use then close a socket in a precise context : connecting to an NNTP server and getting back some newsgroup articles. Posting some articles on an NNTP server using the POST command is not much more complicated.
The next step is therefore coding an HTML news client (and get rid of Netscape:p).
It is also very easy to store the articles, index them using some search engine such as ht://dig (http://www.htdig.org/) and then you have a web based application for keyword searching some newgroups.
An example of such an application is available at http://www.phpindex.com/ng/