function feedPeek(obj) { w('
Content in this section may be copyrighted to respective sites and authors.
'); //w('
Under maintenance. Sorry for inconvenience.
'); for (var i = 0; i < obj.count ; i++) { try{ var ent = obj.value.items[i]; var links = ent.link; var comments = " "; var siteUrl = links; if (isArray(links)){ if (links.length > 4 ){ url = links[4].href; }else{ url = links[links.length - 1].href; } comments = l(links[1].href,links[1].title,true); }else{ url = links; } pos =url.indexOf("/",10); if (pos > 0){ siteUrl = url.substring(0,pos); }else{ siteUrl = url; } var pDate = ent.pubDate; var title = ent.title ; var author = ""; /* Proprietary author extraction*/ var authorRegex = /author="[^"]*"/; var authr = title.match(authorRegex); if (authr != null){ title = title.replace(authr,""); authr = authr[0].replace("author=\"",""); authr = authr.replace("\"",""); } if (ent.author != null){ author = ent.author.name; if (ent.author.uri != null){ author = l(ent.author.uri,author,true); } if (authr != null){ author = authr; } author = ' - ' + author ; } temp = ent.description; if (isNotDefined(temp)){ temp = ( ent.content == null ? ent.summary : ent.content).content; temp = (temp.length == 0 && ent.summary != null ? ent.summary.content : temp); if (isNotDefined(temp)){ temp = summary; }else if (temp.length == 0){ temp = ent.summary.content; } } if (temp.length == 0){ temp = ent.summary.content; } /* To extract image tag first. TSome img tags has height and width attributes which limit resize. So extract src link and reconstrcut img tag. Andy */ var regimg = /]*>/; var srcImg = /src="[^"]*"/; var srcImg2 = /src='[^']*'/; var match = temp.match(regimg); var imgText = ''; var imgText2 =''; var isImage = false; var isLargeImage = false; if (match != null && match.length > 0 ){ imgText = match[0]; if (imgText != null && imgText.length > 0 && (imgText.match(srcImg) != null || imgText.match(srcImg2) != null ) ){ if (imgText.match(srcImg) != null ){ imgText2 = ''; }else{ imgText2 = ''; } var imgTextCheck = imgText2.toUpperCase(); if (imgTextCheck.indexOf('.JPG') > 0 || imgTextCheck.indexOf('.GIF') > 0 || imgTextCheck.indexOf('.BMP') > 0 || imgTextCheck.indexOf('.PNG') > 0){ isImage = true; imgText = '
' + imgText2 + '
'; } }else{ imgText = '
' + imgText + '
'; } } /* Blogspot feeds provide thumbnail image. Extract thumbnail to load faster. Andy */ var thumbnail = ent["media:thumbnail"]; if (thumbnail != null){ imgText = ''; imgText = '
' + imgText + '
'; isImage = true; } /*Tags */ if (siteUrl.length < 5) { var s = siteUrl; } var categories = ent.category; var tags = ""; if (categories != null){ if (isArray(categories)){ tags = 'Tags - '; var k = 0; while(categories[k] != null){ tags = tags + makeTagLink(siteUrl,categories[k].term); k++; if (categories[k] != null) tags = tags + ', '; } }else{ tags = 'Tags - ' + makeTagLink(siteUrl,categories.term); } } var re = /<\S[^>]*>/g; var pCnt = temp.replace("
", " ").replace("
", " ").replace(re, "").substring(0,220); if (isImage){ pCnt = imgText+pCnt; } title = l(url, title,true) ; var rmLink = l(url,"...",true); var mnth = pDate.substring(5,7); var ma = a(); if (i%2==0){ w('
'); }else{ w('
'); } d("FeedPeekTitle",title); d("FeedPeekAuthor", ma[parseInt(mnth,10)] + ' ' + pDate.substring(8,10) + author); d("FeedPeekSummary", pCnt + rmLink ); if (comments != " " && tags != 'Tags - '){ d("FeedPeekTags",tags); d("FeedPeekComments",comments); } w('
'); }catch(err){ d("FeedPeekSummary",err ); } } } function makeTagLink(main,tag){ if (tag == null) return ''; if (tag.indexOf('undefined') > -1) { return ''; } var h = main + '/search/label/' + tag; return l(h,tag,true); } function isNotDefined( variable) { return (typeof variable == "undefined"); } function isArray(obj) { return (obj.constructor.toString().indexOf("Array") > 0 ); }