Espero les sea útil en algún proyecto que tengas. Saludos :]
<?php
// $urlRSS = 'http://nelsonkewebs.tumblr.com/rss';
$urlRSS = 'http://feeds.feedburner.com/nelsonkewebs';
$XML = simplexml_load_file($urlRSS);
$items = $XML->channel->item;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>XML Load RSS Publish</title>
<style>
body
{
background: #333;
font-size: 16px;
font-family: Arial, sans-serif;
}
h1
{
color: white;
font-family: Pacifico, Arial, serif;
font-size: 4em;
text-align: center;
text-shadow: cyan 0px 0px 5px;
}
section
{
max-width: 980px;
margin: 0 auto;
}
article
{
background: white;
border-radius: .3em;
margin-bottom: 2em;
padding: 1em;
}
article a
{
text-decoration: none;
color: orange;
}
article a:hover
{
text-decoration: underline;
}
.Item-date
{
font-size: 0.8em;
font-style: italic;
color: gray;
margin-bottom: 1em;
}
</style>
</head>
<body>
<head>
<h1>Nelsonkewebs by RSS XML PHP</h1>
</head>
<section>
<?php foreach ($items as $item): ?>
<article>
<h2 class="Item-title"><a href="<?php echo $item->link; ?>" target="_blank"><?php echo $item->title; ?></a></h2>
<div class="Item-date"><?php echo $item->pubDate; ?></div>
<div class="Item-content"><?php echo $item->description; ?></div>
</article>
<?php endforeach; ?>
</section>
</body>
</html>
No hay comentarios:
Publicar un comentario
¡Muchas por tu comentario! En breve estaré leyéndolo para responderte. Saludos :]