news-extractor▌
nanmicoder/newscrawler · updated May 27, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
从主流新闻平台提取文章内容,输出 JSON 和 Markdown 格式。
News Extractor Skill
从主流新闻平台提取文章内容,输出 JSON 和 Markdown 格式。
独立可迁移:本 Skill 包含所有必需代码,无外部依赖,可直接复制到其他项目使用。
支持平台 (12)
中文平台
| 平台 | ID | URL 示例 |
|---|---|---|
| 微信公众号 | https://mp.weixin.qq.com/s/xxxxx |
|
| 今日头条 | toutiao | https://www.toutiao.com/article/123456/ |
| 网易新闻 | netease | https://www.163.com/news/article/ABC123.html |
| 搜狐新闻 | sohu | https://www.sohu.com/a/123456_789 |
| 腾讯新闻 | tencent | https://news.qq.com/rain/a/20251016A07W8J00 |
国际平台
| 平台 | ID | URL 示例 |
|---|---|---|
| BBC News | bbc | https://www.bbc.com/news/articles/c797qlx93j0o |
| CNN News | cnn | https://edition.cnn.com/2025/10/27/uk/article-slug |
| Twitter/X | https://x.com/user/status/123456789 |
|
| Lenny's Newsletter | lenny | https://www.lennysnewsletter.com/p/article-slug |
| Naver Blog | naver | https://blog.naver.com/username/123456 |
| Detik News | detik | https://news.detik.com/internasional/d-123456/slug |
| Quora | quora | https://www.quora.com/question/answers/123456 |
依赖安装
本 skill 使用 uv 管理依赖。首次使用前需要安装:
cd .claude/skills/news-extractor
uv sync
重要: 所有脚本必须使用 uv run 执行,不要直接用 python 运行。
依赖列表
| 包名 | 用途 |
|---|---|
| pydantic | 数据模型验证 |
| requests | HTTP 请求 |
| curl_cffi | 浏览器模拟抓取 |
| tenacity | 重试机制 |
| parsel | HTML/XPath 解析 |
| demjson3 | 非标准 JSON 解析 |
使用方式
基本用法
# 提取新闻,自动检测平台,输出 JSON + Markdown
uv run .claude/skills/news-extractor/scripts/extract_news.py "URL"
# 指定输出目录
uv run .claude/skills/news-extractor/scripts/extract_news.py "URL" --output ./output
# 仅输出 JSON
uv run .claude/skills/news-extractor/scripts/extract_news.py "URL" --format json
# 仅输出 Markdown
uv run .claude/skills/news-extractor/scripts/extract_news.py "URL" --format markdown
# Twitter 受保护推文 (需要 Cookie)
uv run .claude/skills/news-extractor/scripts/extract_news.py "URL" --cookie "auth_token=xxx; ct0=yyy"
# 列出支持的平台
uv run .claude/skills/news-extractor/scripts/extract_news.py --list-platforms
输出文件
脚本默认输出两种格式到指定目录(默认 ./output):
{news_id}.json- 结构化 JSON 数据{news_id}.md- Markdown 格式文章
工作流程
- 接收 URL - 用户提供新闻链接
- 平台检测 - 自动识别平台类型
- 内容提取 - 调用对应爬虫获取并解析内容
- 格式转换 - 生成 JSON 和 Markdown
- 输出文件 - 保存到指定目录
输出格式
JSON 结构
{
"title": "文章标题",
"news_url": "原始链接",
"news_id": "文章ID",
"meta_info": {
"author_name": "作者/来源",
"author_url": "",
"publish_time": "2024-01-01 12:00"
},
"contents": [
{"type": "text", "content": "段落文本", "desc": ""},
{"type": "image", "content": "https://...", "desc": ""},
{"type": "video", "content": "https://...", "desc": ""}
],
"texts": ["段落1", "段落2"],
"images": ["图片URL1", "图片URL2"],
"videos": []
}
Markdown 结构
# 文章标题
## 文章信息
**作者**: xxx
**发布时间**: 2024-01-01 12:00
**原文链接**: [链接](URL)
---
## 正文内容
段落内容...

---
## 媒体资源
### 图片 (N)
1. URL1
2. URL2
使用示例
提取微信公众号文章
uv run .claude/skills/news-extractor/scripts/extract_news.py \
"https://mp.weixin.qq.com/s/ebMzDPu2zMT_mRgYgtL6eQ"
提取 BBC 新闻
uv run .claude/skills/news-extractor/scripts/extract_news.py \
"https://www.bbc.com/news/articles/c797qlx93j0o"
提取 Twitter 推文
# 公开推文 (无需认证)
uv run .claude/skills/news-extractor/scripts/extract_news.py \
"https://x.com/BarackObama/status/896523232098078720"
# 受保护推文 (需要 Cookie)
uv run .claude/skills/news-extractor/scripts/extract_news.py \
"https://x.com/user/status/123456" --cookie "auth_token=xxx; ct0=yyy"
错误处理
| 错误类型 | 说明 | 解决方案 |
|---|---|---|
无法识别该平台 |
URL 不匹配任何支持的平台 | 检查 URL 是否正确 |
平台不支持 |
非支持的站点 | 本 Skill 仅支持列出的 12 个平台 |
提取失败 |
网络错误或页面结构变化 | 重试或检查 URL 有效性 |
认证失败 |
Twitter Cookie 无效 | 重新获取 Cookie |
注意事项
- 仅用于教育和研究目的
- 不要进行大规模爬取
- 尊重目标网站的 robots.txt 和服务条款
- 微信公众号可能需要有效的 Cookie(当前默认配置通常可用)
- Twitter 公开推文无需认证,受保护推文需要 Cookie
目录结构
news-extractor/
├── SKILL.md # [必需] Skill 定义文件
├── pyproject.toml # 依赖管理
├── references/
│ └── platform-patterns.md # 平台 URL 模式说明
└── scripts/
├── extract_news.py # CLI 入口脚本
├── models.py # 数据模型
├── detector.py # 平台检测
├── formatter.py # Markdown 格式化
└── crawlers/ # 爬虫模块
├── __init__.py
├── base.py # BaseNewsCrawler 基类
├── fetchers.py # HTTP 获取策略
├── wechat.py # 微信公众号
├── toutiao.py # 今日头条
├── netease.py # 网易新闻
├── sohu.py # 搜狐新闻
├── tencent.py # 腾讯新闻
├── bbc.py # BBC News
├── cnn.py # CNN News
├── twitter.py # Twitter/X
├── twitter_client.py # Twitter API 客户端
├── twitter_types.py # Twitter 数据类型
├── lenny.py # Lenny's Newsletter
├── naver.py # Naver Blog
├── detik.py # Detik News
└── quora.py # Quora
参考
How to use news-extractor on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add news-extractor
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches news-extractor from GitHub repository nanmicoder/newscrawler and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate news-extractor. Access the skill through slash commands (e.g., /news-extractor) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.5★★★★★69 reviews- ★★★★★Sakura Jain· Dec 28, 2024
Keeps context tight: news-extractor is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Kwame Flores· Dec 20, 2024
news-extractor has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Mia Chawla· Dec 12, 2024
news-extractor fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Meera Khan· Dec 8, 2024
We added news-extractor from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Ama Singh· Dec 4, 2024
We added news-extractor from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Anaya Verma· Dec 4, 2024
Solid pick for teams standardizing on skills: news-extractor is focused, and the summary matches what you get after install.
- ★★★★★Sakshi Patil· Nov 27, 2024
news-extractor has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Kwame Torres· Nov 27, 2024
Solid pick for teams standardizing on skills: news-extractor is focused, and the summary matches what you get after install.
- ★★★★★Anaya Liu· Nov 27, 2024
Keeps context tight: news-extractor is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Evelyn Srinivasan· Nov 23, 2024
Keeps context tight: news-extractor is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 69