weibo-deep-profile-collect
采集微博个人主页的全量信息,包括基础资料($CONFIG.user)、全部微博、关注列表、收藏列表
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
采集微博个人主页的全量信息,包括基础资料($CONFIG.user)、全部微博、关注列表、收藏列表
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Collect user data from logged-in social platforms (Douyin, Xiaohongshu, Weibo, Douban, Bilibili), cross-analyze to build a precise personal profile, and auto-generate USER.md + MEMORY.md. Use for new user onboarding, personalization, and building user context. 通过用户已登录的社交平台自动采集数据并交叉分析,生成精准用户画像,写入 USER.md 和 MEMORY.md。
采集小红书个人主页的全量信息,包括基础资料、全部发布笔记(含详情正文和标签)、收藏笔记列表(全量)、点赞笔记列表(全量)
采集豆瓣当前登录用户的全量个人信息,包括基础资料、看过/想看的电影、读过/想读的书、广播动态
采集B站当前登录用户的全量个人信息,包括基础资料、投稿视频、收藏夹内容、关注列表
深度采集抖音个人主页信息,包含基础资料、全部作品(含播放数)、喜欢列表、收藏列表、全量关注列表
| name | weibo-deep-profile-collect |
| description | 采集微博个人主页的全量信息,包括基础资料($CONFIG.user)、全部微博、关注列表、收藏列表 |
| version | 2.0.0 |
本 Skill 用于采集微博当前登录用户的个人主页全量信息。通过 window.$CONFIG.user 获取结构化基础资料,滚动加载微博列表、关注列表和收藏列表。
采集内容:
$CONFIG.user:uid/昵称/简介/粉丝数/关注数/微博数/性别/认证信息/头像等)核心技术:window.$CONFIG.user —— 微博页面内置的用户数据对象,返回完整的结构化 JSON,比 DOM 解析更可靠。
⚠️ 执行约束:本 Skill 中的所有 JS 脚本都必须完整复制执行,不可自行简化、改写或省略任何部分。每个脚本都经过实际测试验证,简化会导致数据不完整。
使用 weibo-deep-profile-collect 采集我的微博个人主页信息
无需提供参数,自动检测当前登录用户。
无。本 Skill 自动从 window.$CONFIG.user 检测当前登录用户。
前提条件:浏览器已登录微博账号。
工具:chrome_navigate
参数:
url: https://weibo.com/说明:导航到微博首页,用于提取 $CONFIG.user 数据。
工具:chrome_execute_script
参数:
world: MAINtimeout: 10000jsScript:() => {
try {
const u = window.$CONFIG && window.$CONFIG.user;
if (u) {
return JSON.stringify({
uid: u.idstr || u.id,
screen_name: u.screen_name,
description: u.description,
followers_count: u.followers_count,
friends_count: u.friends_count,
statuses_count: u.statuses_count,
favourites_count: u.favourites_count,
gender: u.gender,
verified: u.verified,
verified_reason: u.verified_reason,
avatar_large: u.avatar_large,
domain: u.domain,
profile_url: u.profile_url
});
}
return JSON.stringify({error: 'no $CONFIG.user'});
} catch(e) {
return JSON.stringify({error: e.message});
}
}
说明:window.$CONFIG.user 是微博页面内置的用户数据对象,包含完整的用户信息。相比 DOM 解析更可靠、字段更全。
输出:uid(后续步骤导航使用)、完整用户资料
工具:chrome_navigate
参数:
url: https://weibo.com/u/{step_2.uid}工具:chrome_execute_script
参数:
world: MAINtimeout: 120000jsScript:async () => {
let prevCount = 0, sameCount = 0;
for (let i = 0; i < 50; i++) {
window.scrollTo({top: document.body.scrollHeight, behavior: 'smooth'});
await new Promise(r => setTimeout(r, 2000));
const cards = document.querySelectorAll(
'article, [class*="card-wrap"], [class*="Feed_body"], [class*="woo-panel-main"]'
).length;
if (cards === prevCount) { sameCount++; if (sameCount > 5) break; }
else { sameCount = 0; }
prevCount = cards;
}
window.scrollTo({top: 0}); await new Promise(r => setTimeout(r, 500));
const MAX_WEIBOS = 200; // 微博上限200条
const weibos = [];
document.querySelectorAll(
'article, [class*="card-wrap"], [class*="Feed_body"]'
).forEach(el => {
if (weibos.length >= MAX_WEIBOS) return;
const text = el.textContent.trim();
if (text.length > 20 && text.length < 2000) {
weibos.push(text.substring(0, 200));
}
});
return JSON.stringify({
weiboCount: weibos.length, weibos, sampled: weibos.length >= MAX_WEIBOS
});
}
说明:滚动加载全部微博。使用多种 CSS 选择器匹配微博卡片(兼容不同版本页面)。智能停止:连续5轮无新增卡片则停止。
工具:chrome_navigate
参数:
url: https://weibo.com/u/page/follow/{step_2.uid}说明:⚠️ 必须使用新版URL格式 /u/page/follow/{uid}。旧格式 /u/{uid}/follow 会重定向到首页。
工具:chrome_execute_script
参数:
world: MAINtimeout: 60000jsScript:async () => {
await new Promise(r => setTimeout(r, 3000));
// 滚动加载全部
for (let i = 0; i < 15; i++) {
window.scrollTo({top: document.body.scrollHeight, behavior: 'smooth'});
await new Promise(r => setTimeout(r, 1500));
}
window.scrollTo({top: 0}); await new Promise(r => setTimeout(r, 500));
// 提取关注用户(上限500人)
const MAX_USERS = 500;
const users = [], seen = new Set();
document.querySelectorAll('a[href*="/u/"]').forEach(a => {
const href = a.getAttribute('href') || '';
const m = href.match(/\/u\/(\d+)/);
if (!m) return;
const linkUid = m[1];
if (seen.has(linkUid)) return;
// 排除侧边栏推荐
if (a.closest('[class*="wbpro-side-card"]')) return;
// 必须有信息容器(woo-box-item-flex),内含昵称+简介
const infoDiv = a.querySelector('[class*="woo-box-item-flex"]');
if (!infoDiv || infoDiv.children.length < 2) return;
// 第一个子div = 昵称,第二个 = 简介/认证
const nickname = infoDiv.children[0]?.textContent.trim() || '';
const desc = infoDiv.children[1]?.textContent.trim() || '';
if (nickname.length > 0 && nickname.length <= 30 && users.length < MAX_USERS) {
seen.add(linkUid);
users.push({name: nickname, uid: linkUid, desc: desc.substring(0, 60)});
}
});
return JSON.stringify({count: users.length, users, sampled: users.length >= MAX_USERS});
}
说明:滚动加载并提取关注用户列表。关键技术:
a[href*="/u/"] 链接,内含头像容器(woo-avatar-main) + 信息容器(woo-box-item-flex)wbpro-side-card 容器内)工具:chrome_navigate
参数:
url: https://weibo.com/u/page/fav/{step_2.uid}工具:chrome_execute_script
说明:与步骤4类似的滚动+提取逻辑,应用于收藏页面。
最终结果:此步骤完成后,所有数据采集完毕。
工具:chrome_close_tabs
window.$CONFIG.user 返回的字段包括:
idstr/id:用户 UIDscreen_name:昵称description:个人简介followers_count:粉丝数friends_count:关注数statuses_count:微博数favourites_count:收藏数gender:性别(m/f)verified:是否认证verified_reason:认证原因avatar_large:头像 URLdomain:个性域名| 页面 | URL格式 |
|---|---|
| 个人主页 | weibo.com/u/{uid} |
| 关注 | weibo.com/u/page/follow/{uid} |
| 粉丝 | weibo.com/u/page/follow/{uid}?relate=fans |
| 收藏 | weibo.com/u/page/fav/{uid} |
⚠️ 旧版 /u/{uid}/follow 格式已失效,会重定向到首页。
问题1:$CONFIG.user 返回 null
window.$CONFIG 是否仍存在问题2:关注页重定向到首页
/u/page/follow/{uid} 格式问题3:微博数量为0
statuses_count=0)