Professional Web Applications Themes

Getting list of newsgroups via php - PHP Development

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I am trying to write a PHP script that will download a list of all the newsgroups on a news server and put them into a MySQL database. I bought a $50 book that had some NNTP examples in it, but none of them show how to just download the groups, not the articles. I tried on my own for about 2 hours with no luck. If someone can point me in the right direction to download the group list using PHP, I think I can figure out how to write it to a ...

  1. #1

    Default Getting list of newsgroups via php

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    I am trying to write a PHP script that will download a list of all
    the newsgroups on a news server and put them into a MySQL database.
    I bought a $50 book that had some NNTP examples in it, but none of
    them show how to just download the groups, not the articles. I tried
    on my own for about 2 hours with no luck. If someone can point me in
    the right direction to download the group list using PHP, I think I
    can figure out how to write it to a database.

    Thanks,
    Travis

    -----BEGIN PGP SIGNATURE-----
    Version: PGP Personal Privacy 6.5.8

    iQA/AwUBP2PbWIHFTs7ILPgZEQLAjwCfd3nWCRXbo+aLWem6X6SuDE aVypwAoN17
    VUlkCyCO1trp6sajVqAG/DrZ
    =+jvW
    -----END PGP SIGNATURE-----


    Travis McCarter Guest

  2. #2

    Default Re: Getting list of newsgroups via php


    To get the list of all newsgroups use the LIST command:

    ----------- FROM RFC977 (NNTP PROTOCOL)-----------

    LIST

    Returns a list of valid newsgroups and associated information. Each
    newsgroup is sent as a line of text in the following format:

    group last first p

    where <group> is the name of the newsgroup, <last> is the number of
    the last known article currently in that newsgroup, <first> is the
    number of the first article currently in the newsgroup, and <p> is
    either 'y' or 'n' indicating whether posting to this newsgroup is
    allowed ('y') or prohibited ('n').

    -------------------- END ------------------------

    For more infos about the NNTP protocol:
    [url]http://www.faqs.org/rfcs/rfc977[/url]


    HTH

    "Travis McCarter" <travismsunrisenetwork.net> wrote in message
    news:3f63dbee_2athenanews.com...
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > I am trying to write a PHP script that will download a list of all
    > the newsgroups on a news server and put them into a MySQL database.
    > I bought a $50 book that had some NNTP examples in it, but none of
    > them show how to just download the groups, not the articles. I tried
    > on my own for about 2 hours with no luck. If someone can point me in
    > the right direction to download the group list using PHP, I think I
    > can figure out how to write it to a database.
    >
    > Thanks,
    > Travis
    >
    > -----BEGIN PGP SIGNATURE-----
    > Version: PGP Personal Privacy 6.5.8
    >
    > iQA/AwUBP2PbWIHFTs7ILPgZEQLAjwCfd3nWCRXbo+aLWem6X6SuDE aVypwAoN17
    > VUlkCyCO1trp6sajVqAG/DrZ
    > =+jvW
    > -----END PGP SIGNATURE-----
    >
    >

    sam Guest

  3. #3

    Default Re: Getting list of newsgroups via php

    But how do you do it programatically? Can I read each group into a string?

    Travis


    "sam" <rbaba99caramail.com> wrote in message
    news:bk1bdl$1lid$1news.cybercity.dk...
    >
    > To get the list of all newsgroups use the LIST command:
    >
    > ----------- FROM RFC977 (NNTP PROTOCOL)-----------
    >
    > LIST
    >
    > Returns a list of valid newsgroups and associated information. Each
    > newsgroup is sent as a line of text in the following format:
    >
    > group last first p
    >
    > where <group> is the name of the newsgroup, <last> is the number of
    > the last known article currently in that newsgroup, <first> is the
    > number of the first article currently in the newsgroup, and <p> is
    > either 'y' or 'n' indicating whether posting to this newsgroup is
    > allowed ('y') or prohibited ('n').
    >
    > -------------------- END ------------------------
    >
    > For more infos about the NNTP protocol:
    > [url]http://www.faqs.org/rfcs/rfc977[/url]
    >
    >
    > HTH
    >
    > "Travis McCarter" <travismsunrisenetwork.net> wrote in message
    > news:3f63dbee_2athenanews.com...
    > > -----BEGIN PGP SIGNED MESSAGE-----
    > > Hash: SHA1
    > >
    > > I am trying to write a PHP script that will download a list of all
    > > the newsgroups on a news server and put them into a MySQL database.
    > > I bought a $50 book that had some NNTP examples in it, but none of
    > > them show how to just download the groups, not the articles. I tried
    > > on my own for about 2 hours with no luck. If someone can point me in
    > > the right direction to download the group list using PHP, I think I
    > > can figure out how to write it to a database.
    > >
    > > Thanks,
    > > Travis
    > >
    > > -----BEGIN PGP SIGNATURE-----
    > > Version: PGP Personal Privacy 6.5.8
    > >
    > > iQA/AwUBP2PbWIHFTs7ILPgZEQLAjwCfd3nWCRXbo+aLWem6X6SuDE aVypwAoN17
    > > VUlkCyCO1trp6sajVqAG/DrZ
    > > =+jvW
    > > -----END PGP SIGNATURE-----
    > >
    > >
    >
    >

    Travis McCarter Guest

  4. #4

    Default Re: Getting list of newsgroups via php

    $nntp_server = "news.nntpserver.com"; // set your server here
    $nntp_port = 119; // do not change this unless you know what you do.
    $time_out = 30; // timeout in seconds

    $fp = fsockopen($nntp_server, $nntp_port, $errno, $errstr, $time_out);

    if (!$fp) {
    echo "$errstr ($errno)";
    } else {

    fputs($fp, "LIST\r\n");

    while (!feof($fp)) {

    // read one line from the socket

    $buffer = fgets($fp,256);

    // $buffer will contain something like
    // this "alt.comp.lang.php 00000515 00000926 y"

    /*
    do what you want to do with the buffer here
    */
    }

    fclose ($fp);
    }



    "Travis McCarter" <travismsunrisenetwork.net> wrote in message
    news:3f64a134$1_6athenanews.com...
    > But how do you do it programatically? Can I read each group into a
    string?
    >
    > Travis
    >
    >
    > "sam" <rbaba99caramail.com> wrote in message
    > news:bk1bdl$1lid$1news.cybercity.dk...
    > >
    > > To get the list of all newsgroups use the LIST command:
    > >
    > > ----------- FROM RFC977 (NNTP PROTOCOL)-----------
    > >
    > > LIST
    > >
    > > Returns a list of valid newsgroups and associated information. Each
    > > newsgroup is sent as a line of text in the following format:
    > >
    > > group last first p
    > >
    > > where <group> is the name of the newsgroup, <last> is the number of
    > > the last known article currently in that newsgroup, <first> is the
    > > number of the first article currently in the newsgroup, and <p> is
    > > either 'y' or 'n' indicating whether posting to this newsgroup is
    > > allowed ('y') or prohibited ('n').
    > >
    > > -------------------- END ------------------------
    > >
    > > For more infos about the NNTP protocol:
    > > [url]http://www.faqs.org/rfcs/rfc977[/url]
    > >
    > >
    > > HTH
    > >
    > > "Travis McCarter" <travismsunrisenetwork.net> wrote in message
    > > news:3f63dbee_2athenanews.com...
    > > > -----BEGIN PGP SIGNED MESSAGE-----
    > > > Hash: SHA1
    > > >
    > > > I am trying to write a PHP script that will download a list of all
    > > > the newsgroups on a news server and put them into a MySQL database.
    > > > I bought a $50 book that had some NNTP examples in it, but none of
    > > > them show how to just download the groups, not the articles. I tried
    > > > on my own for about 2 hours with no luck. If someone can point me in
    > > > the right direction to download the group list using PHP, I think I
    > > > can figure out how to write it to a database.
    > > >
    > > > Thanks,
    > > > Travis
    > > >
    > > > -----BEGIN PGP SIGNATURE-----
    > > > Version: PGP Personal Privacy 6.5.8
    > > >
    > > > iQA/AwUBP2PbWIHFTs7ILPgZEQLAjwCfd3nWCRXbo+aLWem6X6SuDE aVypwAoN17
    > > > VUlkCyCO1trp6sajVqAG/DrZ
    > > > =+jvW
    > > > -----END PGP SIGNATURE-----
    > > >
    > > >
    > >
    > >
    >
    >

    sam Guest

  5. #5

    Default Re: Getting list of newsgroups via php

    "Travis McCarter" <travismsunrisenetwork.net> wrote in message
    news:3f64a134$1_6athenanews.com
    > But how do you do it programatically? Can I read each group into a string?
    Have a look to mynewsgroups :) :
    [url]http://mynewsgroups.sourceforge.net/[/url]

    Hope this help you!


    --
    Posted via Mailgate.ORG Server - [url]http://www.Mailgate.ORG[/url]
    Moreno Tiziani Guest

  6. #6

    Default Re: Getting list of newsgroups via php

    "Travis McCarter" <travismsunrisenetwork.net> wrote in message
    news:3f64a134$1_6athenanews.com
    > But how do you do it programatically? Can I read each group into a string?
    Have a look to mynewsgroups :) :
    [url]http://mynewsgroups.sourceforge.net/[/url]

    Hope this help you!




    --
    Posted via Mailgate.ORG Server - [url]http://www.Mailgate.ORG[/url]
    Nexus Guest

Similar Threads

  1. Getting a list of newsgroups with PHP
    By la_haine in forum PHP Development
    Replies: 0
    Last Post: October 1st, 04:36 PM
  2. Get list of Newsgroups from server using PHP
    By Travis McCarter in forum PHP Development
    Replies: 1
    Last Post: September 15th, 07:25 AM
  3. NEWSGROUPS
    By paulc7 in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 3
    Last Post: July 9th, 10:20 PM
  4. why so many PHP newsgroups??
    By Jeffrey Silverman in forum PHP Development
    Replies: 3
    Last Post: July 8th, 04:46 PM
  5. Google's newsgroups
    By Eric J. Roode in forum PERL Miscellaneous
    Replies: 0
    Last Post: July 8th, 12:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139