Some time ago, there was a question on the Drupal forums about wrapping content from another site to your site.
Here is a basic PHP code snippet that would do just that. You may need to fiddle with the HTML to make the paths absolute to the site that you are wrapping.
If you have improvements, please let me know.
Also, please do not use this to leech content from other sites, and obey their copyright rules.
Method 1: Using fopen on a URL
$url = "http://example.com";
$handle = @fopen ( $url, "r" );
if ( $handle ) {
while ( true ) {
$data = fgets ( $handle, 4096 );
print $data;
if ( true == feof( $handle ) ) {
break;
}
}
fclose ( $handle );
}
else {
$result .= t("Could not contact host: ") . $url;
}
Method 2: Using fopen on a URL - more concise way
After writing the above, Drupal hacker par excellance, Karoly Negyesi (a.k.a. chx), found a much more elegant and simple solution:
Most Comments
Most commented on articles ...