|
 | Topic :: [PHP] RSS en PHP | |  |
| | | Index › PHP/MySQL › [PHP] RSS en PHP | 1  | [PHP] RSS en PHP | zaterdag 11 november 2006 om 18:35 |
| Peeetr
6 Posts | Dan maak ik hier ook maar eens een startpost
Mijn eerste PHP experiment was deze en dit is echt leuk om te maken 
-----------------------------------------------------------
Fok.nl Nieuws
-----------------------------------------------------------

http://www.peter-thijssen.nl/php/Newsfeed/index.php
-----------------------------------------------------------
| Code |
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.1rnAccept: */*rnAccept-Language: de-chrnAccept-Encoding: gzip, deflaternUser-Agent: RoelVB ScriptrnHost: \$server:\$portrnConnection: Keep-Alivernrn";
fputs($fp, $com);
while  !feof($fp))
{
$cont .= fread($fp, 500);
}
fclose($fp);
$cont = substr($cont, strpos($cont, "rnrn") + 4);
return $cont;
}
}
imagepng($image);
imagedestroy($image);
?>
|
| Laatst bewerkt door RoelVB op zaterdag 11 november 2006 om 18:56
 |
| Re: [PHP] RSS en PHP | zaterdag 03 februari 2007 om 20:33 |
| Carharttguy
Administrator 42 Posts | lol, je eerste? Mijn eerste php experimenten ware de echo functie uitprobere  |
 |
| Re: [PHP] RSS en PHP | woensdag 16 januari 2008 om 15:46 |
| Psvhoolie
8 Posts | lol ik moet nog beginnen aan php  |
 |
| Re: [PHP] RSS en PHP | woensdag 27 augustus 2008 om 20:09 |
| Byboy
7 Posts | lekker script =) |
 |
| 1  |
| |
|
| |
|