hupu/hot
hupuRead-only虎扑步行街热帖
bbs.hupu.com
Last 7 days
0
Last 30 days
0
All time
0
hupu/hot.js
/* @meta
{
"name": "hupu/hot",
"description": "虎扑步行街热帖",
"domain": "bbs.hupu.com",
"args": {},
"readOnly": true,
"example": "tap site hupu/hot"
}
*/
async function(args) {
const resp = await fetch('https://bbs.hupu.com/all-gambia');
if (!resp.ok) return {error: 'HTTP ' + resp.status};
const html = await resp.text();
const doc = new DOMParser().parseFromString(html, 'text/html');
const items = [...doc.querySelectorAll('.list-item-wrap')].map((wrap, i) => {
const link = wrap.querySelector('.t-info > a');
const titleEl = wrap.querySelector('.t-title');
const lightsEl = wrap.querySelector('.t-lights');
const repliesEl = wrap.querySelector('.t-replies');
const labelEl = wrap.querySelector('.t-label a');
if (!link || !titleEl) return null;
const href = link.getAttribute('href') || '';
const tid = href.replace(/\D/g, '');
const lights = parseInt((lightsEl?.textContent || '').replace(/\D/g, '')) || 0;
const replies = parseInt((repliesEl?.textContent || '').replace(/\D/g, '')) || 0;
const isHot = (link.className || '').includes('hot');
return {
rank: i + 1,
tid,
title: titleEl.textContent.trim(),
url: 'https://bbs.hupu.com' + href,
lights,
replies,
isHot,
forum: labelEl?.textContent.trim() || ''
};
}).filter(Boolean);
return {count: items.length, items};
}
Updated Mar 31, 2026Created Mar 31, 2026SHA-256: faab3a849a11…