Comunidad de diseño web y desarrollo en internet online

RSS - PHP

Citar            
MensajeEscrito el 10 Jun 2008 12:22 am
hola como va?

Código :

$env=mysql_query("select algo from tabla order by id desc") ;
while ($row=mysql_fetch_row($env)){ 
$rss="http://www.fotolog.com/$row[0]/feed/main/rss20";
$rss=join("",file(&$rss));
$rss=str_replace(array("\n","\r"),"",$rss);
preg_match("#<title><\!\[CDATA\[(.*?)\]\]><\/title>#",$rss,$titulo);
preg_match_all("#<media:thumbnail url=\"(.*?)\" height=\"75\" width=\"100\" \/>#",$rss,$img_t);
preg_match_all("#<media:content url=\"(.*?)\"(.+?)>#",$rss,$img_f);
$title=$titulo['1'];
echo"<table height='119px' width='770px'><tr><td width='50%'>
<a href=''>$title</a><br /><br />$row[0]</td>";
echo"<td width=40% align=right>";
for($i=0;$i<=count($img_t['1']) - 4;$i++) {
echo '<img src='.$img_t['1'][$i].'>';
} 
echo '</td></tr></table><br />';
}


quiero q me muestre la info d los fotolog insertados en la db. El, mejor dicho los problemas son..
Fatal error: Maximum execution time of 30 seconds exceeded in on line 64
es la linea $rss=join("",file(&$rss));
Warning: file(http://www.fotolog.com//feed/main/rss20) [function.file]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in on line 64
Warning: join() [function.join]: Bad arguments. in on line 64

No entiendo cual es el problema :S.

Por nehuen

43 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 10 Jun 2008 02:27 am
Parece que no puede abrir la URL (file(&$rss)) y se cuelga

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 10 Jun 2008 04:02 pm
y q se puede hacer para q funcione?:S

Por nehuen

43 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 10 Jun 2008 04:18 pm

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 10 Jun 2008 05:13 pm
non, ya proble cambiar el timeout y no funcion. Con fopen tampoco funciona...

Por nehuen

43 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 10 Jun 2008 05:22 pm
El timeout usualmente no te lo dejan cambiar en un shared server, porque puedes colgar el servidor.
Abre a mano la página, quizás simplemente no se puede abrir

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 10 Jun 2008 06:12 pm
justamente eso t iba a comentar. Con el wamp, abriendola en localhost, funciona sin problemas. algunas veces m sale el timeout pero m muestra los resultados igual, en el server directamente no muestra nada y me sale esos errores q t comente. No se como podre solucionar el problema.
Probe dos millones d maneras y no funciona, en el local si m funciona pero en el server no hay forma. no entiendo q pasa!:S

Código :

$rss=implode(file("http://www.fotolog.com/$row[0]/feed/main/rss20"));
/*Asi funciona en local, no en server.*/

Probe con todo, creo q el problema esta en el server algo q jode. no creo q sea yo.
Ahora lo q no entiendo es q este codigo asi funciona en el server.

Código :

<?
$autor = "shadowng"; // me pongo de ejemplo http://www.fotolog.com/shadowng
$rss   = "http://feed.fotolog.com/".$autor."/feed/main/rss20";
$rss   = join("",file(&$rss));
$rss   = str_replace(array("\n","\r"),"",$rss);

preg_match("#<title><\!\[CDATA\[(.*?)\]\]><\/title>#",$rss,$titulo);
preg_match_all("#<media:thumbnail url=\"(.*?)\" height=\"75\" width=\"100\" \/>#",$rss,$img_t);
preg_match_all("#<media:content url=\"(.*?)\"(.+?)>#",$rss,$img_f);

echo 'Titulo del Fotolog: '.$titulo['1'];
echo '<br>';
echo 'Fotos: <br>';

for($i=0;$i<=count($img_t['1']) - 1;$i++) {
    echo '<a href="'.$img_f['1'][$i].'"><img src='.$img_t['1'][$i].'></a>';
    echo '<br><br>';
}
?>

Alguien q me expliq o me diga por favor q pasa.. no encuentro solucion.
Desde ya muchas gracias por tus respuestas. :(

Por nehuen

43 de clabLevel



Genero:Masculino  

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.