Web Hosting Talk







View Full Version : php's imap_open NNTP: getting newsgroup list?


=-D
10-31-2005, 10:29 PM
I've been using the PHP IMAP extension to access NTTP news servers.
http://php.net/manual/en/ref.imap.php

I've figured out how to connect and list messages posted for a single newsgroup, but this is my quesiton.........

How do i find out what all the newsgroups are? And then how can i change to them?

Burhan
11-01-2005, 03:08 AM
Not sure its possible with IMAP, but if you do it via sockets, it really easy. Simply send the LIST command, and you will get back a listing of all newsgroups available, along with their message status and if posting is allowed or not; to change to a newsgroup, you use the GROUP command (more information available at RFC 977 (http://www.w3.org/Protocols/rfc977/rfc977.html)).

To make your life easy, why not use Net_NNTP (http://pear.php.net/package/Net_NNTP) -- a nice PEAR package that provides wrappers to almost all of the NNTP commands.