da ultimate feedz reader
by hhanuman
HTML
<script src="http://dl.dropbox.com/u/267716/js/jquery.jgfeed.js"></script>
<script src="http://dl.dropbox.com/u/267716/js/jqueryTimers-1.2.js"></script>
<div class="rss"></div>
CSS
a{text-decoration:none;}
JavaScript
var input = "http://hvg.hu/rss";
//what i wanna do:
//$("div").newz(input);
//what works, but it is ugly:
getFeed($(".rss"), input);
//what is the final goal,
//a plugin with an rss feed argument to attach the
//result to any object:
//$.fn.newz = function(daFeed) {
//not working...:(
//this works:
function getFeed(object, daFeed){
//closure needed?
//var $this = $(this);
$.jGFeed(daFeed,
function(feeds){
for(var i=0;i<feeds.entries.length;i++){
var entry = feeds.entries[i];
var title = entry.title;
var link = entry.link;
var description = entry.contentSnippet;
var pubDate = entry.publishedDate;
var html = "<div class='entry'><h4 class='postTitle'><a class='fancy block' href='" + link + "' target='_blank'>" + title + "</a></h4>";
html += "<em class='date'>" + pubDate + "</em>";
html += "<p class='description'>" + description + "</p></div>";
object.append(html);
}
}, 10);
};