// API接口列表 const API_ENDPOINTS = [ "https://60s-cf.viki.moe/v2/weibo", "https://60s.viki.moe/v2/weibo", "https://60s.b23.run/v2/weibo", "https://60s.114128.xyz/v2/weibo", "https://60s-cf.114128.xyz/v2/weibo" ]; // 当前使用的API索引 let currentApiIndex = 0; // DOM元素 const hotListElement = document.getElementById('hotList'); const updateTimeElement = document.getElementById('updateTime'); // 格式化时间 function formatDate(date) { const year = date.getFullYear(); const month = String(date.getMonth() + 1).padStart(2, '0'); const day = String(date.getDate()).padStart(2, '0'); const hours = String(date.getHours()).padStart(2, '0'); const minutes = String(date.getMinutes()).padStart(2, '0'); const seconds = String(date.getSeconds()).padStart(2, '0'); return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; } // 渲染热搜列表 function renderHotList(data) { hotListElement.innerHTML = ''; data.forEach((item, index) => { const hotItem = document.createElement('div'); hotItem.className = 'hot-item'; const rankClass = index < 3 ? `top-${index + 1}` : ''; hotItem.innerHTML = `