Open julien51 opened 9 years ago
Just to further comment - if you go here: https://developers.google.com/feed/ you'll see the Google API feed is deprecated as of: December 15th, 2016, meaning this will no longer work, you'll just get "This API is no longer available" returned. You could likely use https://rss2json.com as a replacement and add some simple json parsing to make it work the same...
Hey guys, Yeah, I'm totally open to a PR to replace the google feed api with something else :)
Hi AnalogJ , I wrote a really quick way to essentially re-write your library.
Assuming you have a
The following script (using jQuery and the api.rss2json.com) would parse it and populate the div:
$('div.rssFeed').each(function(){
var item = $(this).attr('data-feed');
var fullURL = 'https://api.rss2json.com/v1/api.json?rss_url=' + encodeURI( item );
var p = $(this);
$.get( fullURL, function( data ) {
var html = "<ul>";
for(var i =0; i < data.items.length; i++ ){
//console.log( data.items[i].link );
html = html + '<li><a target="_blank" href="' + data.items[i].link + '">' + data.items[i].title + '</a></li>';
}
$(p).html( html + '</ul>' );
});
});
EX:
<div class="rssFeed" data-feed="http://feed.dilbert.com/dilbert/daily_strip"></div>
Generates something like this:
You currently use Google's Feed API. Would you be open to a pull request which adds support to other APIs like @superfeedr's: see an example here.