async function app() {
const url =
"https://m.weibo.cn/api/container/getIndex?containerid=106003type%3D25%26t%3D3%26disable_hot%3D1%26filter_type%3Drealtimehot";
const json = await got(url).json();
let cardsHot = null;
for (let item of json.data.cards) {
if (item.title.indexOf("实时热点") >= 0) {
cardsHot = item;
break;
}
}
const cards = cardsHot.card_group
.map((item) => {
return {
pic: item.pic,
icon: item.icon || "",
desc: item.desc,
link: item.scheme,
};
})
.filter((item) => {
if (item.pic.indexOf("stick") >= 0) {
return false;
}
if (item.icon.indexOf("recommend") >= 0) {
return false;
}
return true;
})
.slice(0, 10);
console.log(cards);
}
app();