-function that get the rss link and pass thru the Google AJAX Api and transform into json format, then is treated like a JSON file.
First : create a JQuery file (EX: configRSS.js) and put the below code
$(document).ready(function () {
RssFeed();
});
function RssFeed(){
var url = "http://your_blog_name/feeds/posts/default?alt=rss";
$.ajax({
url: 'http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(url),
dataType: 'json',
success: function (data) {
var rssDestino = $("#divRSS"); // div of destination
var feedEntrys = data.responseData.feed.entries; // post of blog
var blogTitle = data.responseData.feed.title; // name of blog
var blogUrl = data.responseData.feed.link; // link post
rssDestino.empty(); //empty the div before
rssDestino.append('<h2><a href="' + blogUrl + '">' + blogTitle + '</a></h2>'); // title
//now for each post....
for (var i = 0; i < feedEntrys.length; i++) {
var pubdate = new Date(feedEntrys[i].publishedDate);
var dataPost = pubdate.toLocaleDateString();
rssDestino.append('<p><i> <u>Data de Publicação:</u> ' + dataPost + '</i> <a href="' + feedEntrys[i].link +
'"><b>Url Post</b></a></p>');
rssDestino.append('<p>' + feedEntrys[i].content + '</p>');
rssDestino.append('<hr />');
}
}
});
}
Second : create the HTML page
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="jq/configRSS.js"></script>
</head>
<body>
<div id="divRSS">
here will appear the rss feeds
</div>
</body>
</html>
Example: See Demo
