fetchlinks

Help
Klasno
2001-05-19
2003-05-05
  • Klasno

    Klasno - 2001-05-19

    when i use this command
    $snoopy->fetchlinks("http://www.somepage.com");
        print $snoopy->results;

    the script returns only "Array"

     
    • Anonymous - 2002-01-27

      This will pull back a list of links using fetchlinks:

      if($snoopy->fetchlinks("http://www.cnn.com/"))
      {
      echo "response code: ".$snoopy->response_code."<br>\n";

          while(list($key,$val) = each($snoopy->results))
          echo $key.": ".$val."<br>\n";
          echo "<p>\n";
          echo "<PRE>".htmlspecialchars($snoopy->results)."</PRE>\n";
      }
      else
      echo "error fetching document: ".$snoopy->error."\n";

       
    • Anonymous - 2003-03-20

      i get this if i try above code

      response code: HTTP/1.1 200 OK
      0: http://www.cnn.com//
      1: http://www.cnn.com//Array

       
    • Beate Paland

      Beate Paland - 2003-03-25

      I also get the same :-/
      Isn't there someone out there who got an answer for this prob??

       
    • Beate Paland

      Beate Paland - 2003-03-25

      me, again.
      with this hack ([ 625354 ] snoopy->fetchlinks returns only one link) all works fine :-)

       
    • Anonymous - 2003-05-05

      Snoopy has an error on line 590 in Snoopy.class.inc

      change from
      preg_match_all("'<\s*a\s+.*href\s*=\s*            # find <a href=
      to
      topreg_match_all("'<\s*a\s+.*?href\s*=\s*            # find <a href=

      i.e. add ? after .*

      use implode for display array like

      <?php
          include "Snoopy.class.inc";
          $snoopy = new Snoopy;
         
          $snoopy->fetchlinks("http://www.cnn.com/");
          print implode("=====<br><br>",$snoopy->results);
          //print $snoopy->results;

      ?>

       
    • Anonymous - 2003-05-05

      SORRY,  i removed ; after http://www.cnn.com/" in the above message

      Snoopy has an error on line 589 in Snoopy.class.inc

      change from
      preg_match_all("'<\s*a\s+.*href\s*=\s* # find <a href=
      to
      preg_match_all("'<\s*a\s+.*?href\s*=\s* # find <a href=

      i.e. add ? after .*

      use implode for display array like

      <?php
      include "Snoopy.class.inc";
      $snoopy = new Snoopy;

      $snoopy->fetchlinks("http://www.cnn.com/");
      print implode("=====<br><br>",$snoopy->results);
      //print $snoopy->results;

      ?>

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks