rss
<?function my_headlines($url) {
$rdf = ($url);
$fp = ($rdf['host'], 80, $errno, $errstr, 15);
if (!$fp) {
$content = "<font class=\"content\">Problema!</font>";
return;
}
if ($fp) {
($fp, "GET " . $rdf['path'] . "?" . $rdf['query'] . " HTTP/1.0\r\n");
($fp, "HOST: " . $rdf['host'] . "\r\n\r\n");
$string = "";
while(!($fp)) {
$pagetext = ($fp,300);
$string .= ($pagetext);
}
($fp,"Connection: close\r\n\r\n");
($fp);
$items = ("</item>",$string);
$content = "<font class=\"content\">";
for ($i=0;$i<10;$i++) {
$link = (".*<link>","",$items[$i]);
$link = ("</link>.*","",$link);
$title2 = (".*<title>","",$items[$i]);
$title2 = ("</title>.*","",$title2);
if ($items[$i] == "") {
$content = "";
return;
} else {
if (($link,$title)) {
$cont = 1;
$content .= "<img src=\"images/arrow.gif\" border=\"0\" hspace=\"5\"><a href=\"$link\" target=\"new\">$title2</a><br>\n";
}
}
}
}
echo "$content";
}
my_headlines
?>