使用方式: GET /?platform=baidu|weibo|zhihu
附加参数:
?platform=zhihu&refresh=true - 强制刷新缓存
?platform=weibo&refresh=true - 强制刷新缓存
// 获取百度热搜
fetch('https://你的worker.xx.workers.dev/?platform=baidu')
.then(r => r.json())
.then(data => {
if (data.success) {
console.log('数据来源:', data.source);
console.log('是否缓存:', data.cached);
console.log('数据:', data.data);
}
})
// 获取知乎热榜 (强制刷新)
fetch('https://你的worker.xx.workers.dev/?platform=zhihu&refresh=true')
.then(r => r.json())
.then(console.log)