parse more items
Posted
by
user449891
on Stack Overflow
See other posts from Stack Overflow
or by user449891
Published on 2011-06-20T20:15:41Z
Indexed on
2011/06/22
0:23 UTC
Read the original article
Hit count: 252
Currently I'm using zRSSFeed to parse a Menalto Gallery2 RSS feed, and only get about 5 details: link, description, title, etc. There are about 11 items within the tag.
How can I get zRSSFeed to return all of them, including
<media:thumbnail url="http...">
which includes a colon?
Code from ZRSSFeed
var html='';var row='odd';var xml=getXMLDocument(data.xmlString);var xmlEntries=xml.getElementsByTagName('item');
//if(options.header)html+='<div class="rssHeader">'+'<a href="'+feeds.link+'" title="'+feeds.description+'">'+feeds.title+'</a>'+'</div>';
//html+='<div class="rssBody">'+'<ul>';for(var i=0;i<feeds.entries.length;i++){
html+='<div class="rssBody">';for(var i=0;i<feeds.entries.length;i++){
var entry=feeds.entries[i];var entryDate=new Date(entry.publishedDate);var pubDate=entryDate.toLocaleDateString()+' '+entryDate.toLocaleTimeString();
//html+='<li class="rssRow '+row+'">'
html+='<div>'
//if(options.date)html+='<div>'+pubDate+'</div>'
if(options.content){
//if(options.snippet&&entry.contentSnippet!=''){
//var content=entry.contentSnippet;
//}else{
var content=entry.content;
sq_arr = content.split('>');
sq_brr = sq_arr[0].split('?');
sq_crr = sq_arr[1].split(' width');
sq_drr = sq_crr[0].split('src');
sq_b = new RegExp(/\d+(?=\")/g).exec(sq_drr[1]);
sq_c = sq_b*1-1;
sq_rplc = sq_brr[1].replace(/\d+(?=\")/g, sq_c);
sq_str = sq_brr[0] + '?g2_view=core.DownloadItem&' + sq_rplc + '>' + sq_crr[0] +'" height="75" width="75"></a>';
content = sq_str.r`enter code here`eplace(/&/g, '&');
//}
//html+='<p>'+content+'</p>'
html+=content
//html+='<'+options.titletag+'><a href="'+entry.link+'" title="View this feed at '+feeds.title+'" target="'+options.linktarget+'">'+entry.title+'</a></'+options.titletag+'>'
}
(A more human readable version -- cwallenpoole)
var html='';
var row='odd';
var xml=getXMLDocument(data.xmlString);
var xmlEntries=xml.getElementsByTagName('item');
html+='<div class="rssBody">';
for(var i=0;i<feeds.entries.length;i++){
var entry=feeds.entries[i];
var entryDate=new Date(entry.publishedDate);
var pubDate=entryDate.toLocaleDateString()+' '+entryDate.toLocaleTimeString();
html+='<div>'
if(options.content){
var content=entry.content;
sq_arr = content.split('>');
sq_brr = sq_arr[0].split('?');
sq_crr = sq_arr[1].split(' width');
sq_drr = sq_crr[0].split('src');
sq_b = new RegExp(/\d+(?=\")/g).exec(sq_drr[1]);
sq_c = sq_b-1;
sq_rplc = sq_brr[1].replace(/\d+(?=\")/g, sq_c);
sq_str = sq_brr[0] + '?g2_view=core.DownloadItem&' + sq_rplc + '>' + sq_crr[0] +'" height="75" width="75"></a>';
content = sq_str.r`enter code here`eplace(/&/g, '&');
html+=content
}
// missing }???
© Stack Overflow or respective owner