Skip to content

Instantly share code, notes, and snippets.

@danielribes
Last active December 25, 2015 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielribes/7045225 to your computer and use it in GitHub Desktop.
Save danielribes/7045225 to your computer and use it in GitHub Desktop.
Manera rápida (de implementar) y muy básica para extraer los URL RSS del HTML de una web generada con Wordpress, o que tenga los metas type RSS concretos.
<?php
$pagina = file('http://blogs.adobe.com/'); // aqui la URL de la web
foreach( $pagina as $linia)
{
$eltoken = strstr($linia, 'type="application/rss+xml"');
if( $eltoken )
{
$urltoken = strstr($eltoken, 'href="');
$url = explode('"',$urltoken);
echo $url[1]; // aqui los ves
echo "<br />";
}
// mejor no recorrer todo el array $pagina
if( strstr($linia, '</head>') ){
break;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment