by
- Miguceamma likes this
Posted by Patrique on 22/09/2007, 12:10
Posted by Patrique on 16/03/2007, 16:42
Posted by Patrique on 15/03/2007, 03:35
<html> <head> <title>Leitor Rss</title> </head> <script language="javascript" type="text/javascript"> var RSSRequestObject = false; // XMLHttpRequest Object var Backend = 'http://blogsearch.google.com/blogsearch_feeds?hl=pt-br&q=youtube&ie=utf-8&num=10&output=rss'; window.setInterval("update_timer()", 1200000); if (window.XMLHttpRequest) RSSRequestObject = new XMLHttpRequest(); if (window.ActiveXObject) RSSRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); /* * onreadystatechange function */ function ReqChange() { if (RSSRequestObject.readyState==4) { if (RSSRequestObject.responseText.indexOf('invalid') == -1) { var node = RSSRequestObject.responseXML.documentElement; var channel = node.getElementsByTagName('channel').item(0); var title = channel.getElementsByTagName('title').item(0).firstChild.data; var link = channel.getElementsByTagName('link').item(0).firstChild.data; //content = '<div class="channeltitle"><a href="'+link+'">'+title+'</a></div><ul>'; content = '<table width="550" border="0" cellspacing="1" cellpadding="3"><tr><td class="channeltitle"></a></td></tr>'; // Browse items var items = channel.getElementsByTagName('item'); for (var n=0; n < items.length; n++) { var itemTitle = items[n].getElementsByTagName('title').item(0).firstChild.data; var itemLink = items[n].getElementsByTagName('link').item(0).firstChild.data; try { var itemPubDate = '['+items[n].getElementsByTagName('pubDate').item(0).firstChild.data+'] '; } catch (e) { var itemPubDate = ''; } content += '<tr><td align="left"><a href="'+itemLink+'">'+itemTitle+'</a></td></tr>'; // content += '<tr><td align="left"><a href="'+itemLink+'">'+itemTitle+'</a><br />'+itemPubDate+'</td></tr>'; } content += '</table>'; document.getElementById("ajaxreader").innerHTML = content; document.getElementById("status").innerHTML = "Done."; } else { document.getElementById("status").innerHTML = "<div class=error>Ocorreu um erro<div>"; } HideShow('status'); } } /* * Main AJAX RSS reader request */ function RSSRequest() { HideShow('status'); document.getElementById("status").innerHTML = "Carregando resutados..."; RSSRequestObject.open("GET", Backend , true); RSSRequestObject.onreadystatechange = ReqChange; RSSRequestObject.send(null); } /* * Timer */ function update_timer() { RSSRequest(); } function HideShow(id){ var el = GetObject(id); if(el.style.display=="none") el.style.display=''; else el.style.display='none'; } function GetObject(id){ var el = document.getElementById(id); return(el); } </script> <body onLoad="RSSRequest();"> <div id="status" style="display:none"></div> <div id="ajaxreader"></div> </body> </html>
Posted by Patrique on 13/03/2007, 00:25
Posted by Patrique on 20/03/2006, 00:23
Community Forum Software by IP.Board
Licensed to: Webmasters Online