1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
<?php
header ("Content-type: image/png");
\$image = imagecreatefrompng("bg.png");
\$nieuws = getcontent("rss.fok.nl", 80, "/feeds/nieuws/index.php");
\$games = getcontent("rss.fok.nl", 80, "/feeds/games/index.php");
\$nieuwstitel = substr(\$nieuws, strpos(\$nieuws, "<title>")+515);
\$nieuwstitel = substr(\$nieuwstitel, 0, strpos(\$nieuwstitel, "</title>"));
\$gamestitel = substr(\$games, strpos(\$games, "<title>")+496);
\$gamestitel = substr(\$gamestitel, 0, strpos(\$gamestitel, "</title>"));
\$text = imagecolorallocate(\$image, 98, 118, 29);
imagestring(\$image, 3, 2, 25, "Nieuws Headline: ".\$nieuwstitel, \$text);
imagestring(\$image, 3, 9, 40, "Games Headline: ".\$gamestitel, \$text);
function getcontent(\$server, \$port, \$file) {
\$cont = "";
\$ip = gethostbyname(\$server);
\$fp = fsockopen(\$ip, \$port);
if !\$fp)
{
return "Unknown";
}
else
{
\$com = "GET \$file HTTP/1.1\\r\\nAccept: */*\\r\\nAccept-Language: de-ch\\r\\nAccept-Encoding: gzip, deflate\\r\\nUser-Agent: RoelVB Script\\r\\nHost: \$server:\$port\\r\\nConnection: Keep-Alive\\r\\n\\r\\n";
fputs(\$fp, \$com);
while !feof(\$fp))
{
\$cont .= fread(\$fp, 500);
}
fclose(\$fp);
\$cont = substr(\$cont, strpos(\$cont, "\\r\\n\\r\\n") + 4);
return \$cont;
}
}
imagepng(\$image);
imagedestroy(\$image);
?>
|