Created
January 12, 2018 04:43
-
-
Save evilnapsis/cbfc36f2aa87554728b4d6d240a70e33 to your computer and use it in GitHub Desktop.
Ejemplo de uso de SimplePie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "simplepie-1.5/autoloader.php"; | |
$url = "http://evilnapsis.com"; | |
$s = new SimplePie(); | |
$s->set_feed_url($url); | |
@$s->init(); | |
echo "<h1>".$s->get_title()."</h1>"; | |
echo "<h4>".$s->get_description()."</h4>"; | |
for($i=0;$i<10;$i++){ | |
$item = $s->get_item($i); | |
echo "<a href='".$item->get_link()."'>".$item->get_title()."</a>"; | |
echo "<p>".$item->get_description()."</p>"; | |
// echo $item->get_content(); | |
echo "<p><i>Fecha y hora: ".$item->get_date("Y-m-d h:i:s")."</i></p>"; | |
echo "<p>Autor: ".$item->get_author()->get_name()."</p>"; | |
echo "<br>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment