<div id="who-india-widget">
<h3 style="margin:0 0 15px 0; padding-bottom:8px; border-bottom:3px solid #0093d0; font-family:Arial, sans-serif; color:#333;">
WHO India Updates
</h3>
<div id="who-items" style="font-family:Arial, sans-serif; font-size:14px; line-height:1.5;">
Loading latest updates from WHO India...
</div>
<div style="margin-top:15px; font-size:12px; text-align:right;">
<a href="https://www.who.int/india" target="_blank" style="color:#0093d0; text-decoration:none;">
Visit WHO India Official Site →
</a>
</div>
</div>
<script>
// Live fetch using public RSS-to-JSON service (reliable proxy)
async function loadWHOIndia() {
const container = document.getElementById('who-items');
try {
// Best available proxy for WHO pages (as official RSS is limited)
const proxyUrl = 'https://api.rss2json.com/v1/api.json?rss_url=https://www.who.int/india';
const response = await fetch(proxyUrl);
const data = await response.json();
let html = '';
// Show top 7 recent items
data.items.slice(0, 7).forEach(item => {
const pubDate = new Date(item.pubDate);
const timeAgo = Math.floor((Date.now() - pubDate.getTime()) / (1000 * 60 * 60 * 24));
html += `
<div style="margin-bottom:16px; padding-bottom:12px; border-bottom:1px solid #eee;">
<a href="${item.link}" target="_blank" style="text-decoration:none; color:#0066cc; font-weight:600; line-height:1.35;">
${item.title}
</a>
<div style="margin-top:5px; font-size:12.5px; color:#555;">
${timeAgo === 0 ? 'Today' : timeAgo + ' day' + (timeAgo > 1 ? 's' : '') + ' ago'}
</div>
</div>
`;
});
container.innerHTML = html || '<p style="color:#666;">No recent updates available at the moment.</p>';
} catch (error) {
// Fallback with latest known feature stories (as of April 2026)
container.innerHTML = `
<div style="color:#d00; font-size:13px; line-height:1.4;">
Live feed temporarily unavailable.<br><br>
<strong>Recent Feature Stories:</strong><br><br>
• No road, no map — but no child left behind (28 Jan 2026)<br>
• A silver lining: mercury-free devices in health care (7 Jan 2026)<br>
• Eyes on the road: safety matters (1 Dec 2025)<br><br>
<a href="https://www.who.int/india" target="_blank" style="color:#0093d0;">Visit WHO India for latest updates →</a>
</div>
`;
console.log("WHO India widget error:", error);
}
}
// Auto-load when the gadget renders
window.onload = loadWHOIndia;
</script>
<style>
#who-india-widget {
background: #ffffff;
border: 1px solid #ddd;
padding: 18px;
border-radius: 8px;
box-shadow: 0 3px 10px rgba(0,0,0,0.06);
margin-bottom: 20px;
}
#who-india-widget a:hover {
text-decoration: underline;
}
</style>
0 $type={blogger}:
Post a Comment