Google AJAX Feed API 0
Abr27
Hace poco salio Google AJAX Feed API, esta rebueno para leer RSS o Atom sin la necesidad de hacerlo con librerias como Magpie para PHP… nos evitamos alojarlo x’D porque solo usamos un codigo muy corto y simple en javascript ![]()
Solo debes registrarte, tomar tu key y listo… el API puede regresar los datos en formato JSON y XML (tambien se pueden combinar) aparte esta la documentacion para la clases y todo eso.
La forma mas sensilla de hacer uno… me tinca asi:
HTML:
-
<script type=“text/javascript”>
-
google.load("feeds", "1");
-
function initialize() {
-
var feed = new google.feeds.Feed("http://www.lml.cl/blog/?feed=rss2");
-
feed.load(function(result) {
-
if (!result.error) {
-
var container = document.getElementById("feed");
-
var html="";
-
html+="<ul>";
-
for (var i = 0; i <result.feed.entries.length; i++) {
-
var entry = result.feed.entries[i];
-
html+=‘<li>‘;
-
html+=’<p>‘;
-
html+=’<a href="’+entry.link+‘" target="_blank">‘+entry.title+’</a>‘;
-
html+=’<br />‘;
-
html+=entry.contentSnippet;
-
html+=’</p>‘;
-
html+=’</li>‘;
-
}
-
html+="<ul>";
-
container.innerHTML=html;
-
}
-
});
-
}
-
google.setOnLoadCallback(initialize);
-
</script>
facil no? se interpreta asi
Cualquier sugenrencia su güen comment no mas x’D

