Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/01/2010, 15:04
dvd181191
 
Fecha de Ingreso: abril-2009
Mensajes: 356
Antigüedad: 15 años
Puntos: 7
Coger informacion de otras webs

Código PHP:
<?php require_once('Connections/QQHHJuegos.php'); ?>
<?

function substring_between($haystack,$start,$end) { 
    if (
strpos($haystack,$start) === false || strpos($haystack,$end) === false) { 
        return 
false
    } else { 
        
$start_position strpos($haystack,$start)+strlen($start); 
        
$end_position strpos($haystack,$end); 
        return 
substr($haystack,$start_position,$end_position-$start_position); 
    } 


?>
<?php 

$numero_noticia 
4720;
$numero_maximo 4746;

while(
$numero_maximo >= $numero_noticia){

$url 'http://www.blogsdenoticias.com/adelantos/41-adelantos/'
echo 
$url $url."".$numero_noticia;

// Obtengo el contenido de la web 

$text file_get_contents($url); 

//function to get a substring between between two other substrings 

$text htmlspecialchars($text);

$titulo substring_between($text,'&lt;title&gt;','&lt;/title&gt;'); 

$cuerpo substring_between($text,'&lt;td valign=&quot;top&quot; colspan=&quot;2&quot;&gt;','&lt;!-- START of joscomment --&gt;'); 

html_entity_decode($cuerpo);

mysql_query("INSERT INTO  `Noticias`.`Noticias` (`id` ,`nombre` ,`contenido`) VALUES (NULL ,'".$titulo."','".$cuerpo."')");

$numero_noticia $numero_noticia 1;

}

?>
he creado este codigo con el cual voy copiando las notiacias de un blog pero pongo tambien de donde biene y eso

si alguien me pudiera ayudar para poder generalizar un poco y poder coger noticias y mas de otros sitios me ayudaria mucho
__________________
Cannabis; todo sobre el mundo de la marihuana