<!-- 
This pen is using the Feednami library. You can build really nice stuff with it. Find it at "https://toolkit.sekando.com/docs/en/feednami".

Thanks for this awesome library to the developers of Feednami!
-->
<ul id="Newsfeed"></ul>
body {
  background: #444;
	-webkit-background-size: cover;
	-moz-background-size: cover;
	-o-background-size: cover;
	background-size: cover;

	font-family: 'Roboto', sans-serif;
	margin:0;
	padding:0;
}

ul {
	list-style-type: none;
}

#Newsfeed {
  max-width: 1350px;
  margin: 0 auto;
  padding-top: 25px;
  padding-bottom: 65px;
}

.RSScard {
	padding: 20px 25px;

	margin-left: 20px;
	margin-top: 20px;

	min-width: 200px;
	max-width: 200px;
	min-height: 225px;

	opacity: 0.875;
	background-color: #202B33;

  color: #388E3C;
  font-size: 0.85em;
	text-align: center;
	overflow: hidden;
	box-shadow: 0 0 8px rgba(0,0,0, 0.25);
	float:left;
  
	-webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.RSScard a {
	text-decoration: none;
	color: #ededed;
  font-size: 0.75em;
	font-weight: 300;
	opacity: 1;
}

.RSScard:hover {
	opacity: 1;
	background-color: #202B33;
}
$(document).ready(function() {
    loadRSS('https://rss.nytimes.com/services/xml/rss/nyt/Politics.xml', '#Newsfeed', 'Elcom');   
});

function loadRSS(link, htmlContainer, closingDate) {
    var url = link;
    var cDate = closingDate;
    var container = $(htmlContainer);

    feednami.load(url, function(result){
        if (result.error) {
            console.log(result.error);
        } else {
            var entries = result.feed.entries;
            for(var i = 0; i < 5; i++){
                var entry = entries[i];
                container.append("<li class=\"RSScard\"><p><h2>" 
                    + "<a href=\"" + entry.link + "\" target=\"_blank\">" + entry.title + "</a>" 
                    + "</h2></p>"+ entry.description + "</li>");
            }
        }
    });
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js
  2. https://cdn.rawgit.com/sekando/feednami-client/master/releases/1.0.2.min.js