Last active
June 21, 2024 21:10
-
-
Save ximosa/2d2947ab5666d8e458879476dd7bbc6b to your computer and use it in GitHub Desktop.
listado de un blog de blogger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#postList12 { | |
max-width: 600px; margin: auto; | |
} | |
#postList12 li{ | |
list-style: none; | |
} | |
#postList12 a { | |
background-color: #eee; | |
color: black; | |
display: block; | |
padding: 12px; | |
text-decoration: none; | |
margin-bottom: 10px; | |
} | |
#postList12 a:hover { | |
background-color: #ccc; | |
} | |
</style> | |
<h2> Ultimas colecciones publicadas</h2> | |
<div><ul id="postList12"></ul></div> | |
<script type="text/javascript"> | |
var startIndex = 1; | |
var maxResults = 100; | |
function sendQuery12() | |
{ | |
var scpt = document.createElement("script"); | |
scpt.src = "https://imagen.webgae.com/feeds/posts/summary?alt=json&callback=processPostList12&start-index=" + startIndex + "&max-results=" + maxResults; | |
document.body.appendChild(scpt); | |
} | |
function processPostList12(root) | |
{ | |
var elmt = document.getElementById("postList12"); | |
if (!elmt) | |
return; | |
var feed = root.feed; | |
if (feed.entry.length > 0) | |
{ | |
for (var i = 0; i < feed.entry.length; i++) | |
{ | |
var entry = feed.entry[i]; | |
var title = entry.title.$t; | |
for (var j = 0; j < entry.link.length; j++) | |
{ | |
if (entry.link[j].rel == "alternate") | |
{ | |
var url = entry.link[j].href; | |
if (url && url.length > 0 && title && title.length > 0) | |
{ | |
var liE = document.createElement("li"); | |
var a1E = document.createElement("a"); | |
a1E.href = url; | |
a1E.textContent = title; | |
liE.appendChild(a1E); | |
elmt.appendChild(liE); | |
} | |
break; | |
} | |
} | |
} | |
if (feed.entry.length >= maxResults) | |
{ | |
startIndex += maxResults; | |
sendQuery12(); | |
} | |
} | |
} | |
sendQuery12(); | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment