我正在使用http://www.zazar.net/developers/jquery/zrssfeed/上的工具,从feeds.feedburner.com阅读提要
我的要求是从feeds.feedburner.com读取提要,并获取其标题,内容,然后使用这两个参数使用rest API在我的网站上发布线程。目前,我无法使用位于http://www.zazar.net/developers/jquery/zrssfeed/的插件获取供稿的标题和内容。
我的代码如下:
$(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);
});
});
});
该代码段是从zazar.net使用的,如果我能够将标题和内容传递给REST API,则它可以满足我的要求。
如果需要提供更多详细信息,请告诉我。
提前致谢
我已经检查了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);
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句