This is a discussion on Get list of Newsgroups from server using PHP within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I am trying to write a PHP script that will download all of the available newsgroups from a server and ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am trying to write a PHP script that will download all of the available
newsgroups from a server and write them into a MySQL database. I have tried a few different things but cannot figure out even how to download the list. If anyone can help it would be appreciated. Thanks, Travis |
|
|||
|
"Travis McCarter" <travism@sunrisenetwork.net> wrote in message
news:3f64c6f6$1_9@athenanews.com... > I am trying to write a PHP script that will download all of the available > newsgroups from a server and write them into a MySQL database. I have tried > a few different things but cannot figure out even how to download the list. > If anyone can help it would be appreciated. While there might be a class already written to do this here is how I would handle it. Basically NNTP is done over a plain-text unencrypted connection. That means technically you could telnet to your news server and read your groups that way if you wanted. Open a socket to port 119 on the news server (I think that's the NNTP port) and issue the "LIST" command. Stuff all of the output in an array and then stuff that into your MySQL database. You might need to parse each listing as it might return something like group.name number_of_messages. But that shouldn't be a big deal. Anthony |