Need help with Snoopy class function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • toby casey

    Need help with Snoopy class function

    Dear all,

    I am brand new to php, but learning quickly. I need to be able to go
    to website, obtain the form elements, cycle through the form elements,
    fetch the links for each page that results from the submission of the
    form elements, and then fetch all the content of the pages refered in
    the links (its approx 115,000 links). If i understand it right,
    Snoopy is the way to go with this. But the problem is, is that we
    cannot get snoopy to work (expect for the submit function). I have
    gone through all the text files that come with snoopy, and even when
    we just cut and paste the example code from the text files, it does
    not work. for example, when we pasted the fetchtext function example
    code we got the following error:
    .............

    Notice: Undefined variable: postdata in
    c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
    1153

    Warning: fsockopen(): php_network_get addresses: gethostbyname failed
    in c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
    1092

    Warning: fsockopen(): unable to connect to lnk.ispi.net:80 in
    c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
    1092


    Notice: Uninitialized string offset: 0 in
    c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 23

    Notice: Uninitialized string offset: 1 in
    c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 24

    Notice: Uninitialized string offset: 2 in
    c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 25

    .............
    we made absolutely no changes to the code, just a simple cut and
    paste. Given the way that snoopy is discussed on various groups, we
    get the feeling that this is a really easy class function to use,
    which leads us to believe that we are missing some very simple step.
    please if anybody can help us out we would be greatful, or better yet,
    if anybody has done a task simular to ours at hand, if you could just
    post some code as to how you did it....thank you for your time.

    toby
  • toby casey

    #2
    Re: Need help with Snoopy class function

    toby2tongues@ho tmail.com (toby casey) wrote in message news:<ba949ce6. 0407171636.3993 2c86@posting.go ogle.com>...[color=blue]
    > Dear all,
    >
    > I am brand new to php, but learning quickly. I need to be able to go
    > to website, obtain the form elements, cycle through the form elements,
    > fetch the links for each page that results from the submission of the
    > form elements, and then fetch all the content of the pages refered in
    > the links (its approx 115,000 links). If i understand it right,
    > Snoopy is the way to go with this. But the problem is, is that we
    > cannot get snoopy to work (expect for the submit function). I have
    > gone through all the text files that come with snoopy, and even when
    > we just cut and paste the example code from the text files, it does
    > not work. for example, when we pasted the fetchtext function example
    > code we got the following error:
    > ............
    >
    > Notice: Undefined variable: postdata in
    > c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
    > 1153
    >
    > Warning: fsockopen(): php_network_get addresses: gethostbyname failed
    > in c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
    > 1092
    >
    > Warning: fsockopen(): unable to connect to lnk.ispi.net:80 in
    > c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
    > 1092
    >
    >
    > Notice: Uninitialized string offset: 0 in
    > c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 23
    >
    > Notice: Uninitialized string offset: 1 in
    > c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 24
    >
    > Notice: Uninitialized string offset: 2 in
    > c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 25
    >
    > ............
    > we made absolutely no changes to the code, just a simple cut and
    > paste. Given the way that snoopy is discussed on various groups, we
    > get the feeling that this is a really easy class function to use,
    > which leads us to believe that we are missing some very simple step.
    > please if anybody can help us out we would be greatful, or better yet,
    > if anybody has done a task simular to ours at hand, if you could just
    > post some code as to how you did it....thank you for your time.[/color]

    We are running php 4.3.7, windows xp, and the Windows IIS[color=blue]
    >
    > toby[/color]

    Comment

    • lawrence

      #3
      Re: Need help with Snoopy class function

      toby2tongues@ho tmail.com (toby casey) wrote in message news:<ba949ce6. 0407172201.f6cc 2d4@posting.goo gle.com>...[color=blue]
      > toby2tongues@ho tmail.com (toby casey) wrote in message news:<ba949ce6. 0407171636.3993 2c86@posting.go ogle.com>...[color=green]
      > > Dear all,
      > >
      > > I am brand new to php, but learning quickly. I need to be able to go
      > > to website, obtain the form elements, cycle through the form elements,
      > > fetch the links for each page that results from the submission of the
      > > form elements, and then fetch all the content of the pages refered in
      > > the links (its approx 115,000 links). If i understand it right,
      > > Snoopy is the way to go with this. But the problem is, is that we
      > > cannot get snoopy to work (expect for the submit function). I have
      > > gone through all the text files that come with snoopy, and even when
      > > we just cut and paste the example code from the text files, it does
      > > not work. for example, when we pasted the fetchtext function example
      > > code we got the following error:
      > > ............
      > >
      > > Notice: Undefined variable: postdata in
      > > c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
      > > 1153
      > >
      > > Warning: fsockopen(): php_network_get addresses: gethostbyname failed
      > > in c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
      > > 1092
      > >
      > > Warning: fsockopen(): unable to connect to lnk.ispi.net:80 in
      > > c:\inetpub\wwwr oot\gasearch\de v\test files\Snoopy.cl ass.inc on line
      > > 1092
      > >
      > >
      > > Notice: Uninitialized string offset: 0 in
      > > c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 23
      > >
      > > Notice: Uninitialized string offset: 1 in
      > > c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 24
      > >
      > > Notice: Uninitialized string offset: 2 in
      > > c:\inetpub\wwwr oot\gasearch\de v\test files\snoopyfet ch.php on line 25
      > >
      > > ............
      > > we made absolutely no changes to the code, just a simple cut and
      > > paste. Given the way that snoopy is discussed on various groups, we
      > > get the feeling that this is a really easy class function to use,
      > > which leads us to believe that we are missing some very simple step.
      > > please if anybody can help us out we would be greatful, or better yet,
      > > if anybody has done a task simular to ours at hand, if you could just
      > > post some code as to how you did it....thank you for your time.[/color]
      >
      > We are running php 4.3.7, windows xp, and the Windows IIS[color=green]
      > >
      > > toby[/color][/color]


      Does Snoopy have some kind of configuration file that needs to be set?
      It almost seems like the variables are not coming through, which makes
      me wonder if Snoopy assumes that the posted variables are
      automatically becoming global variables. If so, check to see if
      register_global s is set in the php.ini file.

      Comment

      • toby casey

        #4
        Re: Need help with Snoopy class function

        i have been reading everything that i can get my hands on, and have
        fixed alot of problems, but i am still getting this error msg:

        PHP Notice: Undefined index: query in
        c:\inetpub\wwwr oot\gasearch\de v\test files\snoopy
        stuff\Snoopy.cl ass.inc on line 147

        along with a few others. but primarily this one and the same error
        for line 132 (same file) Any time snoopy.class.in c uses the "scheme"
        it gives an undefined index error....i am really going crazy....I am
        assuming that this must be a problem on my computer, because after
        reading all the group postings that i can find that discuss snoopy,
        lots of ppl use it. are there any changes that "must" be made in the
        varible settings and/or php.ini....if somebody can, please help.

        toby

        Comment

        • lawrence

          #5
          Re: Need help with Snoopy class function

          toby2tongues@ho tmail.com (toby casey) wrote in message news:<ba949ce6. 0407222355.2ce3 a80a@posting.go ogle.com>...[color=blue]
          > i have been reading everything that i can get my hands on, and have
          > fixed alot of problems, but i am still getting this error msg:
          >
          > PHP Notice: Undefined index: query in
          > c:\inetpub\wwwr oot\gasearch\de v\test files\snoopy
          > stuff\Snoopy.cl ass.inc on line 147
          >
          > along with a few others. but primarily this one and the same error
          > for line 132 (same file) Any time snoopy.class.in c uses the "scheme"
          > it gives an undefined index error....i am really going crazy....I am
          > assuming that this must be a problem on my computer, because after
          > reading all the group postings that i can find that discuss snoopy,
          > lots of ppl use it. are there any changes that "must" be made in the
          > varible settings and/or php.ini....if somebody can, please help.[/color]

          An undefined index error normally means you're doing something like
          this:

          $howManyUsers = $userInfo["userCount"];

          when no value has ever been placed into the "userCount" index of the
          array $userInfo.

          See anything like that?

          Comment

          • toby casey

            #6
            Re: Need help with Snoopy class function

            >[color=blue]
            > An undefined index error normally means you're doing something like
            > this:
            >
            > $howManyUsers = $userInfo["userCount"];
            >
            > when no value has ever been placed into the "userCount" index of the
            > array $userInfo.
            >
            > See anything like that?[/color]


            that is exactly what is see, but it is in the code of the class
            function, and everybody else in the world seems to be using snoopy
            successfully... .i am thinking that maybe there is a setting in my
            php.ini file that i have incorrectly set...if anybody out there is
            willing, i would love to take a look at somebody php.ini file that has
            ran snoopy successfully. i know its asking alot, and is probably not
            the most security minded thing to do, but i have nobody that i can go
            to for immediate help, and would just like to know for certain that my
            ini is setup right.
            toby
            toby2tongues@ho tmail.com

            Comment

            • lawrence

              #7
              Re: Need help with Snoopy class function

              toby2tongues@ho tmail.com (toby casey) wrote in message news:<ba949ce6. 0408021653.4d86 a71e@posting.go ogle.com>...[color=blue][color=green]
              > >
              > > An undefined index error normally means you're doing something like
              > > this:
              > >
              > > $howManyUsers = $userInfo["userCount"];
              > >
              > > when no value has ever been placed into the "userCount" index of the
              > > array $userInfo.
              > >
              > > See anything like that?[/color]
              >
              >
              > that is exactly what is see, but it is in the code of the class
              > function, and everybody else in the world seems to be using snoopy
              > successfully... .i am thinking that maybe there is a setting in my
              > php.ini file that i have incorrectly set...if anybody out there is
              > willing, i would love to take a look at somebody php.ini file that has
              > ran snoopy successfully. i know its asking alot, and is probably not
              > the most security minded thing to do, but i have nobody that i can go
              > to for immediate help, and would just like to know for certain that my
              > ini is setup right.
              > toby
              > toby2tongues@ho tmail.com[/color]

              My guess is that most PHP coders don't code with error_reporting set
              to all. They should, but they don't. I don't code with error_reporting
              on max either, instead I set it there when I'm debugging.

              Change your error reporting level to make the error messages
              disappear. Or, better, edit Snoopy so that the line that generates the
              error is wrapped in an if (isset($dog["color"])) block.

              Comment

              Working...