xml – 我可以在JSON中提供RSS吗?
我正在编写一个RSS Feed(为了好玩),并且正在查看规范
here.
显然这意味着如果我选择JSON选项,我不会提供“纯粹的”RSS.也就是说,如果我符合规范的其余部分,(定制)读者有可能解析它吗? 换句话说,如果我符合规范,但使用JSON而不是XML是一个可用的RSS提要? 编辑 RG { "title":"example.com","link":"http://www.example.com/","description":"Awesome news about junk","items":[ { "title":"An article","link":"http://www.example.com/an-article","descrition":"Some sample text here","pubDate":"2008-10-27 11:06 EST","author":"example author",},{ "title":"Second","link":"http://www.example.com/SEOnd","pubDate":"2008-10-25 23:20 EST","author":"author mcauthor",{ "title":"third article","link":"http://www.example.com/third-article","pubDate":"2008-10-25 23:18 EST","author":"some other author",} ] }
我相信这已经完成了.
看看这个jQuery扩展:jFeed – RSS/ATOM feed parser jQuery.getFeed(options); 选项: >网址: 例: jQuery.getFeed({ url: 'rss.xml',success: function(feed) { alert(feed.title); } }); 请注意,在这种情况下,’feed’将是一个javascript对象.如果你想使用JSON传递这个,你可以使用javascript JSON utility. 例: var myJSONText = JSON.stringify(feed); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |