Mailinglisten-Archive |
Hallo Dennis,
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
eingebaut.. Schon klappt's.
Bleibt noch die Frage, wie ich nur den richtigen Teil der Wikipedia angezeigt
bekomme , z.B. alles was zu "Volkswagen" in Wikipedia steckt...
Hat noch jmd. dazu eine Idee?
Gruss,
Marc
++++++++++++++++++++++++++++++++
<?
$title = $_GET['title'];
function callback( $buffer ) {
$buffer = substr( $buffer, strpos( $buffer, '<!-- start content --
>' ) );
$buffer = substr( $buffer, 0, strpos( $buffer, '<div
class="printfooter">' ) );
$buffer = str_replace( "/wiki/", "/index.php?title=", $buffer );
$buffer = preg_replace( '/\(<i>http(.*)wiki.phtml(.*)<\/i>\)/', "",
$buffer ); # <span class= 'urlexpansion'>
(<i>http://en.wikipedia.org/w/wiki.phtml?
title=Special:Newpages&limit=500&offset=0</i>)</span>
$buffer = '<b>This is an extract from <a
href="http://www.wikipedia.org" target="_blank">Wikipedia, the Free
Encyclopedia</a></b><hr>' . $buffer;
return $buffer;
}
echo '<html><head><meta http-equiv="Content-Type" content="text/html;
charset=utf-8"></head><body>';
ob_start("callback");
include 'http://www.wikipedia.org/wiki/?title=' . $title;
ob_end_flush();
echo 'Your page footer...';
?>
php::bar PHP Wiki - Listenarchive