0

I am reading a feed from feeds.feedburner.com, using the tool at http://www.zazar.net/developers/jquery/zrssfeed/

My requirement is to read a feed from feeds.feedburner.com and get its Title, Content and then use these 2 parameters to post a thread on my site using a rest API. Currently, I am not able to get the Title and Content of the feed using the plugin at http://www.zazar.net/developers/jquery/zrssfeed/.

My code is below:

$(document).ready(function () {
    $('#test').rssfeed('http://feeds.feedburner.com/thesartorialist',{},function(e) {
        $('h4 a',e).each(function(i) {
            var title = $(this).text();
            if (title.length > 14)

            $(this).text(title);

        });
    });
});

The code snippet is used from the zazar.net, it fulfills my requirement if I am able to fetch the title and content as I need to pass it on to the REST API.

Let me know in case i need to provide more details.

Thanks in advance

4

1 回答 1

0

我已经检查了zazar.net的基本用法 你可以使用它来绑定内容。

$(document).ready(function () {
    $('#test').rssfeed('http://feeds.reuters.com/reuters/oddlyEnoughNews');
});

然后使用 jquery 遍历内容以获取详细信息。

var a2 = [];
var a1 = {"title":"", "content":""};

$("#test .rssBody ul li").each(function(){ 
var b = a1;
b.title = $(this).find("h4 a").html(); 
b.content= $(this).find("p").html();
a2.push(b);
});
于 2013-11-05T08:57:50.797 回答