"; } else { const bloggerWidgetContainer = currentScriptElement ? currentScriptElement.closest('.widget.HTML') : null; if (bloggerWidgetContainer) { // If placeholder is not directly previous, try to find it within the current Blogger HTML widget const placeholderInWidget = bloggerWidgetContainer.querySelector('.featured-content-module-placeholder'); if (placeholderInWidget) { widgetRootElement = placeholderInWidget; widgetRootElement.id = mainWidgetContainerId; widgetRootElement.className = 'featured-content-module-wrapper'; widgetRootElement.innerHTML = ""; } } if (!widgetRootElement) { const tempLoadingDiv = document.querySelector("div.widget.HTML[id='" + (currentScriptElement && currentScriptElement.closest('.widget') ? currentScriptElement.closest('.widget').id : '') + "'] .fcm-loading"); if(tempLoadingDiv) tempLoadingDiv.textContent = "Error de inicialización del widget (placeholder no encontrado)."; console.error("FCM Widget: Placeholder div not found or not correctly placed."); return; } } let blogHomepageUrl = ''; if (typeof BLOG_CMT_domain == 'string' && BLOG_CMT_domain !== '') { blogHomepageUrl = window.location.protocol + '//' + BLOG_CMT_domain; } else if (typeof _WidgetManager != 'undefined' && _WidgetManager._bfo && _WidgetManager._bfo.baseUrl) { blogHomepageUrl = _WidgetManager._bfo.baseUrl.replace(/\/$/, ''); } else { blogHomepageUrl = window.location.origin; } let featuredTag = 'DESTACADO_POR_DEFECTO_INTERNO'; // Default internal tag // Try to get tag from a div.fcm-widget-config-tag within the same parent as the placeholder if (widgetRootElement && widgetRootElement.parentElement) { const configTagDivSibling = widgetRootElement.parentElement.querySelector(".fcm-widget-config-tag"); if (configTagDivSibling && configTagDivSibling.textContent && configTagDivSibling.textContent.trim() !== "") { featuredTag = configTagDivSibling.textContent.trim(); } else { // Fallback for older structures or if config is inside the Blogger widget container but outside placeholder's direct parent const bloggerWidgetContainer = currentScriptElement.closest('.widget.HTML'); if (bloggerWidgetContainer) { const configTagDivInBloggerWidget = bloggerWidgetContainer.querySelector(".fcm-widget-config-tag"); if (configTagDivInBloggerWidget && configTagDivInBloggerWidget.textContent && configTagDivInBloggerWidget.textContent.trim() !== "") { featuredTag = configTagDivInBloggerWidget.textContent.trim(); } } } } const NUM_POSTS = 3; const DEFAULT_THUMBNAIL_URL = "https://via.placeholder.com/1200x675.png?text=Sin+Imagen"; window[callbackFunctionName] = function(json) { const postsDisplayArea = document.getElementById(postsDisplayAreaId); if (!postsDisplayArea) { return; } postsDisplayArea.innerHTML = ''; function escapeHtml(unsafe) { if (typeof unsafe !== 'string') return ''; const div = document.createElement('div'); div.appendChild(document.createTextNode(unsafe)); return div.innerHTML; } function getPostImage(entry) { // 1. Check media$thumbnail (Blogger's provided thumbnail) if (entry.media$thumbnail && entry.media$thumbnail.url) { let thumbnailUrl = entry.media$thumbnail.url; // If it's a YouTube thumbnail, attempt to get a higher quality version if (thumbnailUrl.includes("img.youtube.com/vi/")) { const videoIdMatch = thumbnailUrl.match(/\/vi\/([a-zA-Z0-9_-]{11})\//); if (videoIdMatch && videoIdMatch[1]) { // Prefer sddefault.jpg (640x480) or hqdefault.jpg (480x360) // You can also try maxresdefault.jpg, but it might not always exist. return `https://img.youtube.com/vi/${videoIdMatch[1]}/sddefault.jpg`; } // If regex fails, return the original YouTube thumbnail (it might be hqdefault already) return thumbnailUrl; } else { // For regular Blogger images, try to get a larger size (s1200) return thumbnailUrl.replace(/\/s[0-9]+(-c)?\//, '/s1200/'); } } // 2. Fallback: Search for high-resolution images in post content (e.g. blogger_img_proxy) if (entry.content && entry.content.$t) { const content = entry.content.$t; // Regex for blogger_img_proxy, trying to get a large version const proxyRegex = /(https:\/\/lh3\.googlecontent\.com\/blogger_img_proxy\/[^"']+(?:=w\d+-h\d+[^"']*)?)/g; let matches = content.match(proxyRegex); if (matches && matches.length > 0) { let bestMatch = matches[0]; if (bestMatch.includes("=")) { bestMatch = bestMatch.replace(/=w\d+[^"']*/, '=s1200').replace(/=s\d+[^"']*/, '=s1200'); } else { bestMatch += "=s1200"; } return bestMatch; } // General image regex if no proxy found (less reliable for quality) const imgRegex = /]+src="([^">]+)"/ig; // Added 'i' for case-insensitive let firstImgSrc = null; let matchResult; // Find the first valid image source that isn't a known low-quality placeholder (like feedburner) while((matchResult = imgRegex.exec(content)) !== null) { if (matchResult[1] && !matchResult[1].includes("feeds.feedburner.com")) { firstImgSrc = matchResult[1]; break; } } if (firstImgSrc) { let imgSrc = firstImgSrc; // Attempt to resize if it's a Blogger image if (imgSrc.includes("googlecontent.com/") && !imgSrc.includes("blogger_img_proxy")) { imgSrc = imgSrc.replace(/\/s[0-9]+(-c)?\//, '/s1200/'); } return imgSrc; } } // 3. Final fallback return DEFAULT_THUMBNAIL_URL; } function createSnippet(content, length = 100) { if (!content) return ''; const tempDiv = document.createElement('div'); tempDiv.innerHTML = content; // Decodes HTML entities let text = tempDiv.textContent || tempDiv.innerText || ""; text = text.replace(/\s+/g, ' ').trim(); // Normalize whitespace return text.length > length ? escapeHtml(text.substring(0, length)) + '...' : escapeHtml(text); } function createPostItemHtml(postEntry, itemClass, snippetLength) { const postTitle = postEntry.title.$t; const postUrlEntry = postEntry.link.find(link => link.rel === 'alternate'); const postUrl = postUrlEntry ? postUrlEntry.href : '#'; // Fallback URL const imageUrl = getPostImage(postEntry); const snippetText = createSnippet(postEntry.summary && postEntry.summary.$t ? postEntry.summary.$t : (postEntry.content ? postEntry.content.$t : ''), snippetLength); return ( '' + '
' + '' + escapeHtml(postTitle) + '' + '
' + '
' + '

' + escapeHtml(postTitle) + ' 2g681b

' + (snippetText ? '

' + snippetText + '

' : '') + '
' + '
' ); } if (!json.feed || !json.feed.entry || json.feed.entry.length === 0) { postsDisplayArea.innerHTML = "
No se encontraron posts con la etiqueta '" + escapeHtml(featuredTag) + "'.
"; return; } const posts = json.feed.entry; let finalHtmlContent = ""; if (posts[0]) { finalHtmlContent += createPostItemHtml(posts[0], "fcm-main", 120); } if (posts.length > 1) { let secondaryHtml = ""; for (let i = 1; i < Math.min(posts.length, NUM_POSTS); i++) { secondaryHtml += createPostItemHtml(posts[i], "fcm-secondary-item", 70); } if (secondaryHtml) { finalHtmlContent += "
" + secondaryHtml + "
"; } } if (finalHtmlContent === "") { postsDisplayArea.innerHTML = "
No hay posts para mostrar con la etiqueta '" + escapeHtml(featuredTag) + "'.
"; } else { postsDisplayArea.innerHTML = finalHtmlContent; } }; // Fin de window[callbackFunctionName] if (!blogHomepageUrl) { if (widgetRootElement) widgetRootElement.innerHTML = "
Error: No se pudo determinar la URL del blog.
"; return; } const feedUrl = blogHomepageUrl + "/feeds/posts/default/-/" + encodeURIComponent(featuredTag) + "?alt=json-in-script" + "&max-results=" + NUM_POSTS + "&callback=" + callbackFunctionName; const feedScript = document.createElement('script'); feedScript.type = 'text/javascript'; feedScript.src = feedUrl; feedScript.onerror = function() { const postsDisplayArea = document.getElementById(postsDisplayAreaId); if (postsDisplayArea) postsDisplayArea.innerHTML = "
Error al cargar los datos de los posts.
"; }; document.body.appendChild(feedScript); })(); //]]>
Netanyahu outlines conditions to end war in Gaza, wants to impose 'sterile zone'

Netanyahu outlines conditions to end war in Gaza, wants to impose 'sterile zone' r2e2e

Israeli Prime Minister Benjamin Netanyahu said Wednesday that Israel wants to create a "sterile zone" in the south of the Gaza Strip, where…
More
These Are the Day’s News on X: May 21, 2025

These Are the Day’s News on X: May 21, 2025 2y5z3d

On May 21, 2025, X is alive with global stories—from a deadly bombing in Pakistan to Israel’s potential strike on Iran and a thrilling Europa League …
More
EU Strikes Deal on Patent Rule Exception to Ensure Supply of Critical Products

EU Strikes Deal on Patent Rule Exception to Ensure Supply of Critical Products 6r1658

The European Parliament and EU governments have reached a landmark agreement on new rules allowing emergency access to patent-protected products duri…
More
Trump confronts Ramaphosa with false genocide claims

Trump confronts Ramaphosa with false genocide claims 5t3w4o

Reuters | South African President Cyril Ramaphosa rejected US President Trump’s allegation that white people are disproportionately targeted by crime…
More
Ukrainian ex-politician shot dead outside school in Madrid

Ukrainian ex-politician shot dead outside school in Madrid 44nc

Unidentified gunmen shot dead a former Ukrainian politician outside a school in a wealthy suburb of Madrid, Spain's Interior Ministry said.
More
Target cuts annual forecast as tariff pressure mounts

Target cuts annual forecast as tariff pressure mounts 420o

Target slashed its annual sales forecast after posting a sharp fall in quarterly same-store sales, attributing the declines to weakened consumer conf…
More
These Are the Day’s News on X: May 13, 2025

These Are the Day’s News on X: May 13, 2025 2y2u33

On May 13, 2025, X is ablaze with global conversations—from a French court’s ruling against Gérard Depardieu to India-Pakistan border tensions and a …
More
Saudi crown prince welcomes Trump as US leader begins four-day Middle East tour

Saudi crown prince welcomes Trump as US leader begins four-day Middle East tour 2a2y4t

US President Donald Trump opened his four-day Middle East trip on Tuesday by paying a visit to Saudi Arabia's de facto ruler, Crown Prince Mohamm…
More
Japan's SoftBank Group books first annual profit in four years

Japan's SoftBank Group books first annual profit in four years 1z6zg

Japan's SoftBank reported its first annual profit in four years, likely bringing relief to investors scarred by high-profile failures as it embar…
More
`; container.appendChild(feedSection); const targetElement = document.getElementById(feedConfig.targetElementId); if (!targetElement) { console.error(`Elemento target no encontrado: ${feedConfig.targetElementId}`); const errorDiv = document.createElement('div'); errorDiv.className = 'error-rss'; errorDiv.innerHTML = `Error de configuración: Contenedor para "${sanitizeHtml(feedConfig.title)}" no encontrado.`; container.appendChild(errorDiv); return; } try { const apiUrl = `https://api.rss2json.com/v1/api.json?rss_url=${encodeURIComponent(feedConfig.url)}`; const response = await fetch(apiUrl); if (!response.ok) { throw new Error(`Error de red/servidor (${response.status}) al ar rss2json para ${sanitizeHtml(feedConfig.title)}.`); } const data = await response.json(); if (data.status !== 'ok') { throw new Error(`API Error: ${data.message || 'Error desconocido de rss2json'} para ${sanitizeHtml(feedConfig.title)}.`); } if (!data.items || data.items.length === 0) { targetElement.innerHTML = '
No se encontraron entradas en este feed.
'; return; } targetElement.innerHTML = ''; const items = data.items.slice(0, maxItemsPerFeed); items.forEach((item, index) => { const title = sanitizeHtml(item.title || 'Sin título'); const link = item.link || '#'; const rawSnippet = item.description || item.content || ''; const cleanSnippet = sanitizeHtml(rawSnippet); const truncatedSnippet = truncateText(cleanSnippet, snippetMaxLength); const imageUrl = extractImageUrl(item); const itemDiv = document.createElement('div'); itemDiv.className = 'rss-item'; const imageOnErrorScript = `this.onerror=null; this.src='${placeholderImageUrl}'; this.classList.add('image-load-error');`; let itemHTML = ` ${title}

${title} x1m6u

${truncatedSnippet}

`; if (index === 0) { itemDiv.classList.add('featured-item'); itemDiv.innerHTML = itemHTML; targetElement.appendChild(itemDiv); } else { let smallItemsContainer = targetElement.querySelector('.small-item-container'); if (!smallItemsContainer) { smallItemsContainer = document.createElement('div'); smallItemsContainer.className = 'rss-item small-item-container'; targetElement.appendChild(smallItemsContainer); } const smallItemDiv = document.createElement('div'); smallItemDiv.className = 'rss-item small-item'; smallItemDiv.innerHTML = itemHTML; smallItemsContainer.appendChild(smallItemDiv); } }); } catch (error) { console.error(`Error al obtener o procesar el feed "${sanitizeHtml(feedConfig.title)}":`, error.message, error); targetElement.innerHTML = `
No se pudo cargar: ${sanitizeHtml(feedConfig.title)}.
${sanitizeHtml(error.message)}
`; } } if (mainWidgetContainer) { if (feedsConfig && feedsConfig.length > 0) { feedsConfig.forEach(async (config, index) => { await fetchAndDisplayFeed(config, mainWidgetContainer); if (feedsConfig.length > 1 && index < feedsConfig.length - 1) { const separator = document.createElement('hr'); separator.className = 'feed-separator'; const feedSection = document.getElementById(config.targetElementId)?.parentNode; if (feedSection && feedSection.parentNode === mainWidgetContainer) { mainWidgetContainer.appendChild(separator); } else if (mainWidgetContainer.lastChild) { mainWidgetContainer.appendChild(separator); } } }); } else { mainWidgetContainer.innerHTML = "
No hay feeds configurados para mostrar.
"; } } else { console.error("Contenedor principal del widget 'dual-rss-widget-container' no encontrado."); } }); //]]>