Created
February 27, 2015 14:55
-
-
Save simsketch/d1ed49456e9e034fff42 to your computer and use it in GitHub Desktop.
RSS feed non-secure made secure
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
<div id="rssdata"> | |
<ul class="rss-items"></ul> | |
<div class="loading">Loading RSS items...</div> | |
</div> | |
<script type="text/javascript"> | |
$('#rssdata').ready(function () { | |
var url = 'http://www.someRSSfeed.com'; | |
$.ajax({ | |
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(url), | |
dataType: 'jsonp', | |
success: function (data) { | |
//console.log(data.feed.entries); | |
$(data.responseData.feed.entries).each(function (index, entry) { | |
var item_html = '<li><a target="_blank" href="' + entry.link + '">' + entry.title + '</a></li>'; | |
$('#rssdata ul.rss-items').append(item_html); | |
}); | |
$('#rssdata div.loading').fadeOut(); | |
$('#rssdata ul.rss-items').slideDown(); | |
}, | |
error: function () {} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment