Using sockets in PHP : Get articles from Usenet
Talking to the Server
We are now connected to the server, and can talk to it through th previously opened socket. Let us say we want to get the 10 latest articles from some newsgroup. RFC977 specifies that the first step is to select the right newsgroup with the GROUP command :
GROUP ggg
The required parameter ggg is the name of the newsgroup to be selected (e.g. "net.news"). A list of valid newsgroups may be obtained from the LIST command.
The successful selection response will return the article numbers of the first and last articles in the group, and an estimate of the number of articles on file in the group.
Example:
chrome:~$ telnet my.news.host 119
Trying aa.bb.cc.dd...
Connected to my.news.host.
Escape character is '^]'.
200 my.news.host InterNetNews NNRP server INN 2.2.2 13-Dec-1999 ready (posting ok).
GROUP alt.test
211 232 222996 223235 alt.test
quit
205 .
After receiving the command " GROUP alt.test", the News Server answered "211 232 222996 223235 alt.test". 211 is an RFC defined code (basically saying the command was succesfully executed - check the RFC for more details). It also answered it currently has 232 articles, indexed 222996 for the oldest through 223235 for the latest. These are called article numbers. Now, let us have a count here : 222996 + 232 by no means equals to 232235. The seven missing articles were removed one way or another from the server, either cancelled by their legitimate author (yes, it is possible and easy to do !) or deleted after report of abuse for example.
Be careful though, the server might require authentication before selecting the newsgroup, depending on wether it is a public or private server. It could also let anybody retrieve articles but require authentication to publish an article.
Comments:
RE: Sockets and Half-Life Justin Frydman 02/14/06 01:56
RE: use php exec() to Control Parallel Port coolvista 10/31/05 13:24
RE: Retrieving article from usenet sangeeta chakraborty 10/15/05 00:24
saving scripts Rogy 04/05/05 08:15
how to access external email behind my proxy relly 02/15/05 20:53
RE: Sockets and Half-Life Turk 01/25/05 13:38
And how about those fairies? Sex 12/05/04 04:48
For some reason, Sex 12/05/04 04:47
PLease, how Can i download. Sex Beplaced Ru 12/05/04 04:43
ummmmmmmmm whats this mummy?? Sex Beplaced Ru 12/05/04 04:34
This was closely associated with the rebirth of Freeflashonlinegames Com 12/05/04 04:33
Thanks. I hope other people test it too. Freeflashonlinegames Com 12/05/04 04:33
This was closely associated with the rebirth of Sex Beplaced Ru 12/05/04 04:32
die Reet is anders een gemene man... Freeflashonlinegames Com 12/05/04 04:31
You are right ofcourse... But... Sex Beplaced Ru 12/05/04 04:31
For some reason, Sex Beplaced Ru 12/05/04 04:29
Were there ever real witches? Sex 12/05/04 04:28
This was closely associated with the rebirth of Sex 12/05/04 04:26
What?, don't they know who we are? Freeflashonlinegames Com 12/05/04 04:25
Finally figured this out - my Sex 12/05/04 04:25
If not, what were all the witch trials about? Sex 12/05/04 04:23
PLease, how Can i download. Freeflashonlinegames Com 12/05/04 04:08
RE: HTTP Proxy Servers and PHP Sockets Rev Aaron 04/23/04 10:47
RE: Quake III Protocol Kyle 04/02/04 13:42
RE: Sockets not working...Please help usman shahid 10/19/02 04:58
Retrieving ip from url Smoske 09/20/02 15:19
Sockets not working...Please help Renny 09/19/02 14:03
Sned HTML message to all connected client Jim 09/13/02 08:17
How to use PHP Control Paralle Port Pyrawate 09/09/02 00:32
How to use PHP Control Paralle Port Pyrawate 09/08/02 23:59
RE: Retrive client's ip address Quan Mac 09/04/02 00:54
RE: How to open sockets from behind proxy server Ionut Daia 08/22/02 20:39
ADVANCED PHP SOCKETS Gustavo Almeida 08/14/02 14:34
ADVANCED PHP (SOCKET) Gustavo Almeida 08/14/02 14:27
timeout does not work Osman Darcan 08/06/02 19:32
RE: How to open sockets from behind proxy server zingit 07/18/02 04:53
Stuck Bamma 06/29/02 17:57
RE: Sockets and Half-Life full script here NvE0s 06/26/02 19:41
passing parameter Vit 06/25/02 23:24
Quake III Protocol Johan 06/24/02 15:24
GET?? Giuseppe 06/20/02 05:22
Retrive client's ip address John 06/16/02 03:17
Script for negotiating proxy with user auth. Xixulon 06/14/02 10:52
RE: How to open sockets from behind proxy serve Xixulon 06/14/02 10:49
Wap -> Website -> Computer shutdown. Marek Miettinen 06/14/02 06:56
RE: IRC Socket? Bryan 06/12/02 01:36
RE: Browser Chat client Max Mo 06/11/02 08:10
RE: PHP sockets/networks Kamran 05/07/02 03:49
RE: IRC Socket? rubbi 05/03/02 13:05
RE: PHP sockets/networks Morrissey 04/27/02 03:25
html codes marie shelton 04/22/02 07:23
Proxy Tom 04/15/02 08:59
RE: Re Sockets and Half-Life bstanescu 04/08/02 05:52
PERL Sockets AND PHP Sockets popnikos 04/03/02 09:24
RE: Browser Chat client bluBattery 03/13/02 14:54
cookies mohd 03/09/02 16:37
Accessing POP3 mailbox using PHP Sockets Arun G P Dutt 03/07/02 00:41
RE: socket code Michelle 02/26/02 17:58
RE: Sockets and Half-Life Dave 02/18/02 18:46
RE: Browser Chat client Rob_Earl 02/05/02 22:14
RE: How to redirect in LAN Rob 02/05/02 21:54
RE: importing a html page in a php script Rob 02/05/02 21:32
RE: How to redirect in LAN Rob 02/05/02 21:30
RE: Sockets and Half-Life Rob 02/05/02 15:46
RE: PHP telnet client? Per-Ingar Auberg 02/02/02 06:03
Telnet scripting from PHP Per-Ingar Auberg 02/02/02 06:00
RE: How to open sockets from behind proxy server Valberg Larusson 01/19/02 01:02
socket code Colleen 01/16/02 16:47
RE: How to post a form to another... Palan 01/12/02 17:51
socket response-urg!!! sands 01/09/02 10:50
How can I change xml file to php array S.Murali Krishna 01/08/02 05:21
How to redirect in LAN mk4 01/05/02 05:28
RE: Sockets and Half-Life Ruud Kamphuis 01/01/02 09:05
RE: Sockets and Half-Life Dinesh 12/30/01 14:46
RE: PHP telnet sockets(was client) Gulopine 12/20/01 11:14
importing a html page in a php script joe 12/14/01 20:11
Retrieving article from usenet Bill 12/12/01 18:05
RE: How to open sockets from behind proxy server Steven Chalker 12/11/01 17:04
How to open sockets from behind proxy server Satish Krishna 12/04/01 06:43
Display pictures which are attached? valerie 11/29/01 14:16
Can pictures be displaid which are attached? valerie 11/28/01 18:41
opening sockets in php Yogesh Randhawa 11/28/01 07:33
PHP sockets/networks Armando P. 11/21/01 05:21
How can I catch a socket in action? Albert MAYE 11/05/01 09:58
How to post a form to another... Marcel 11/05/01 08:25
And now, what's is the final script? mc-no-solard 11/04/01 12:41
Can I display pictures which are attached? Jens 11/03/01 10:41
RE: saving php output in html file Tomas 10/29/01 12:51
RE: how to enable socket() in PHP archi69 10/21/01 23:59
RE: Sockets and Half-Life huib bakker 10/07/01 07:46
saving php output in html file andrea 09/28/01 05:49
all about sockets lavanya 09/28/01 05:28
Browser Chat client LeeWynn 09/15/01 19:42
Question Steven C 09/07/01 10:31
FTP connection J.Bijleveld 09/04/01 08:00
RE: I would like to known more about php Ger van Vugt 08/18/01 08:58
how to enable socket() in PHP Diou 07/30/01 03:02
RE: Sockets and Half-Life ady 07/28/01 09:33
How to make only on query Claude 07/27/01 02:56
RE: HTTPS Sockets dRago 07/25/01 04:39
RE: I would like to known more about php Phillip Oertel 07/24/01 04:52
SOCKET PHO Jose Luis Castro 07/18/01 13:09
help me!!! ice_berg16 07/18/01 04:58
RE: Sockets and Half-Life paul 07/09/01 22:55
RE: PHP telnet sockets(was client) OmagaSohe 07/09/01 05:46
RE: IRC Socket? Nilo 07/02/01 11:41
RE: IRC Socket? zeke 07/02/01 02:48
Page Links Ravinder singh 06/29/01 02:44
RE: IRC Socket? Bertrand DUNOGIER 06/26/01 04:12
Sounds with PHPCHAT Alan 06/25/01 12:53
I would like to known more about php Hugo Ivan 06/18/01 10:31
is the socket() function available in windows Paul Villavicencio 06/13/01 07:57
RE: HTTPS Sockets Uwi 06/13/01 07:34
Which nntp server to use? Seb Delcampe 06/07/01 10:59
PHP Sockets... Kyle Olsen 06/06/01 14:41
RE: PHP telnet client? Kyle Olsen 06/04/01 11:30
RE: HTTPS Sockets Jordan 05/25/01 09:58
replacing characters Mike 05/22/01 01:57
Sockets and Half-Life Rafael Bastidas 05/21/01 11:28
Example at phpindex.com/ng Alex 05/21/01 08:17
Getting Headers Only Sean 05/20/01 01:11
RE: HTTPS Sockets Erwin 05/16/01 10:00
HTTPS Sockets Jon Thomas 05/13/01 18:32
PHP telnet client? jchc 05/12/01 23:50
RE: IRC Socket? steve 05/11/01 16:03
RE: decoding attachments Onno Benschop 05/08/01 19:23
Achive this from behind a proxy ! Steve haemelinck 05/06/01 06:19
RE: PHP Sockets on Windows bmpc 05/06/01 04:49
RE: Oy, why did the RFC specify numeric codes? Armel FAUVEAU 05/03/01 09:45
RE: IRC Socket? Armel FAUVEAU 05/03/01 09:42
RE: IRC Socket? Mathieu 'CaPS' Kooiman 05/02/01 23:20
RE: Oy, why did the RFC specify numeric codes? Mathieu 'CaPS' Kooiman 05/02/01 23:18
IRC Socket? Ninconvert 05/02/01 17:33
RE: Oy, why did the RFC specify numeric codes? Armel FAUVEAU 05/02/01 17:20
Radius check using PHP+sockets O. van Zandwijk 05/02/01 15:07
Oy, why did the RFC specify numeric codes? Mathieu 'CaPS' Kooiman 05/01/01 05:59
RE: disconneting .... Dave 05/01/01 05:00
RE: IMAP functions? Dave 05/01/01 04:59
decoding attachments Christian Lund 04/30/01 14:02
RE: IMAP functions? Justin Plock 04/30/01 11:08
PHP Sockets on Windows C Clarke 04/30/01 06:39
RE: IMAP functions? Armel FAUVEAU 04/29/01 17:47
RE: IMAP functions? Xan Nick 04/29/01 10:33
IMAP functions? Justin Plock 04/28/01 01:24
disconneting .... E.Daspet 04/28/01 00:49
If you are looking for help, please post on the appropriate forum here . Your questions will be answered much more quickly.