Rss
<?php
function My_headlines ($url) {
$RDF = Parse_url ($url);
$fp = Fsockopen ($RDF [' Host '], $errno, $ERRSTR, 15);
if (! $fp) {
$content = "<font class=\" content\ ">Problema!</font>";
Return
}
if ($fp) {
Fputs ($fp, "get". $RDF [' Path ']. "?" . $RDF [' query ']. "http/1.0\r\n");
Fputs ($FP, "HOST:". $RDF [' Host ']. "\r\n\r\n");
$string = "";
while (!feof ($fp)) {
$pagetext = fgets ($fp, 300);
$string. = Chop ($pagetext);
}
Fputs ($fp, "connection:close\r\n\r\n");
Fclose ($FP);
$items = Explode ("</item>", $string);
$content = "<font class=\" content\ ">";
For ($i =0 $i <10; $i + +) {
$link = ereg_replace (".*<link>", "" ", $items [$i]);
$link = ereg_replace ("</link>.*", "", $link);
$title 2 = ereg_replace (".*<title>", "" ", $items [$i]);
$title 2 = ereg_replace ("</title>.*", "" ", $title 2);
if ($items [$i] = = "") {
$content = "";
Return
} else {
if (strcmp ($link, $title)) {
$cont = 1;
$content. = "<a href=\" $link \ "target=\" new\ ">$ Title2</a><br>\n ";
}
}
}
}
echo "$content";
}
My_headlines
?>