Avatar Image
Usuario habitual
Usuario habitual

hay alguna forma de leer rss de otra web fuera de mi@, ya ke la funcion fopen de url no esta permitida..., por ejemplo yo kiero meter noticias de google en mi web este seria el codigo fuente:

Codigo:
<?php
/***************************************
Google News Grabber v2
by jordie bodlay
www.revolutiontech.com.au
jbodlay@revolutiontech.com.au

Feel free to use for non-commercial reasons.
Use of google content is subject to google
copyrights. Use at your own risk.

I, jordie bodlay, take no responsibility
for how this script is used by anyone.
By downloading and using this script the
downloader/user accepts any responsibility
for any copyright infringement or any
other misuse.


****************************************/

// required variables
$resultCount = '7'; //maxes out at around 10
$siteURL = 'http://news.google.com/?topic=w';

// To change the layout of the output, please navigate down
// further.


function openSite($website){

$readSite = "";
// trick google into thinking we are just a normal user
ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');

if($openSite = fopen ($website,"r&quotGiño){
while(!feof($openSite)){
$readSite .= fread($openSite, 4096);
}
fclose($openSite);
}else{

echo "Couldn't open $website...";
}
return $readSite;

}


$google = openSite($siteURL);

preg_match_all("|<td valign=top><a href=\"(.*)\" id=r-[0-9]><b>(.*)</b></a><br><font size=-1><font color=#6f6f6f><b>(.*)-</font> <nobr>(.*)</nobr>|Ui",$google,$result);

/*

Output info:
$result[0] - complete results, just junk, not always useable
$result[1] - Array of news URL's
$result[2] - Array of news headlines
$result[3] - Array of news sources
$result[4] - Array of posted times

*/

echo "<table border=0 width=100% cellspacing=0 cellpadding=1>";

for ($i = 0; $i <= $resultCount; $i++) {

/* Change display format here.
The beginning of the table is just above the loop.
The end is just at the end of the loop */

?>
<TR>
<TD><font size=-1 face='times new roman'><B>&#149;</B></TD>
<TD><font size=-1 face='times new roman'><a href="<?=$result[1][$i]?>" target="_blank"><?=$result[2][$i]?></a> - <?=$result[3][$i]?> (<?=$result[4][$i]?&gtGiño</TD>
</TR>
<?

}

echo "</table>";
?>


pero no funciona porke mi@ tiene blokeadas varias funciones...

alguna otra forma?
Avatar Image
Machacateclados
Machacateclados

No estoy seguro de si se puede... pero podrias ver si te sirven las funciones de procesamiento de XML.

ATENCIÓN: Este tema no tiene actividad desde hace más de 6 MESES,
te recomendamos abrir un nuevo tema en lugar de responder al actual
Opciones:
Ir al subforo:
Permisos:
TU NO PUEDES Escribir nuevos temas
TU NO PUEDES Responder a los temas
TU NO PUEDES Editar tus propios mensajes
TU NO PUEDES Borrar tus propios mensajes
Temas similares
No se han encontrado temas similares