Blog

Mini Fetch Code

by

Mini fetch Code

< ?
$theLocation=”http://www.wired.com/”;

preg_match(“/^(https?://)?([^/]*)(.*)/i”, “$theLocation”, $matches);

$theDomain = “http://” . $matches[2];

$page = $matches[3];

$fd = fopen($theDomain.$page, “rb”);

$value = “”;

while(!feof($fd)){
$value .= fread($fd, 4096);
}

fclose($fd);

$start = strpos($value, ““);

$finish = strpos($value, ““);

$length = $finish – $start;

$value = substr($value, $start, $length);

$FinalOutput = preg_replace(“/(href=”?)(/[^"/]+)/”, “1″ . $theDomain . “2″, $value);

echo $FinalOutput;

flush ();

2 Comments

  • Yuppie 3036 days ago

    http://www.win32com.de/

    What does this code do ?

    Reply
  • Jake 1863 days ago

    @Yuppie

    Looks like it extracts code from another site

    Reply

Write your comment

Optional

The Bronco Family
Work With Us