| name | mofa-defuddle |
| description | Extract clean article content from web pages using Defuddle. Converts cluttered HTML to clean Markdown or structured data. Triggers: defuddle, extract content, clean html, article extract, readable |
| requires_bins | npx |
| always | false |
MOFA Defuddle
ๅบไบ Defuddle ็็ฝ้กตๅ
ๅฎนๆๅๅทฅๅ
ท๏ผไปๆไนฑ็็ฝ้กตไธญๆๅๅนฒๅ็ๆ็ซ ๅ
ๅฎน๏ผ่ฝฌๆขไธบ Markdown ๆ็ปๆๅๆฐๆฎใ
Onboarding / ๅผๅงไฝฟ็จ
ๅ็ฝฎ่ฆๆฑ
-
Node.js ๅ npm
node --version
npm --version
-
Defuddle ไผ่ชๅจ้่ฟ npx ๅฎ่ฃ
npx defuddle --version
-
้ช่ฏๅฎ่ฃ
npx defuddle --version
ๅฟซ้ๅผๅง
npx defuddle parse https://example.com/article --markdown
npx defuddle parse https://example.com/article --json
npx defuddle parse https://example.com/article --markdown --output article.md
npx defuddle parse https://example.com/article --property title
ๆ
้ๆ้ค
| ้ฎ้ข | ่งฃๅณๆนๆก |
|---|
command not found: npx | ๅฎ่ฃ
Node.js: https://nodejs.org |
fetch failed | ๆฃๆฅ็ฝ็ป่ฟๆฅ๏ผๆ็ฝ็ซๆๅ็ฌๆบๅถ |
parse failed | ้กต้ขๅฏ่ฝๆฏๅจๆๆธฒๆ๏ผๅฐ่ฏ็จๆต่งๅจๅ
่ทๅ HTML |
| ๅ
ๅฎนๆๅไธๅฎๆด | ๆไบ็ฝ็ซ็ปๆ็นๆฎ๏ผๅฐ่ฏ็ปๅๅ
ถไปๅทฅๅ
ท |
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MOFA DEFUDDLE PIPELINE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
User Request (URL or HTML file)
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Phase 1: INPUT โ
โ โโโโโโโโโโโโโ โ
โ โข Validate URL or file path โ
โ โข Determine output format (markdown/json/property) โ
โ โข Check if site needs special handling โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Phase 2: EXTRACT โ
โ โโโโโโโโโโโโโโโ โ
โ โ
โ npx defuddle parse <source> [options] โ
โ โ
โ Options: โ
โ โข --markdown : Clean markdown output โ
โ โข --json : Structured data with metadata โ
โ โข --property : Extract specific field โ
โ โข --output : Save to file โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Phase 3: POST-PROCESS โ
โ โโโโโโโโโโโโโโโโโโโโโ โ
โ โข Clean up extracted content โ
โ โข Validate output quality โ
โ โข Format for downstream use โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Processed Output
Defuddle ่ฝๅๆ ๅฐ
| ๅ่ฝ | CLI ๅฝไปค | ็จ้ |
|---|
| Markdown ๆๅ | defuddle parse <url> --markdown | ๅนฒๅ็ๆ็ซ ๅ
ๅฎน |
| JSON ๅ
ๆฐๆฎ | defuddle parse <url> --json | ็ปๆๅๆฐๆฎ๏ผๆ ้ข/ไฝ่
/ๆฅๆ/ๅ
ๅฎน๏ผ |
| ๅๅญๆฎตๆๅ | defuddle parse <url> --property title | ๆๅ็นๅฎๅญๆฎต |
| ๆไปถๅค็ | defuddle parse <file.html> --markdown | ๅค็ๆฌๅฐ HTML |
Output Format
Markdown ่พๅบ
# Article Title
Article content in clean markdown format...
- No ads
- No navigation
- No sidebars
- Just the article
JSON ่พๅบ
{
"title": "Article Title",
"description": "Article description or excerpt",
"author": "Author Name",
"date": "2024-01-15",
"domain": "example.com",
"content": "Clean HTML content...",
"markdown": "# Article Title\n\nContent..."
}
Phase 1: Input Validation
if [[ "$input" =~ ^https?:// ]]; then
type="url"
elif [[ -f "$input" ]]; then
type="file"
else
echo "Error: Input must be a URL or existing file"
exit 1
fi
Phase 2: Extraction
ๆๅๆจกๅผ้ๆฉ
| ็จๆท้ๆฑ | ๆจ่ๅฝไปค | ่ฏดๆ |
|---|
| "ๆๅๆ็ซ ๅ
ๅฎน" | --markdown | ๆๅธธ็จ๏ผๅนฒๅๅฏ่ฏป |
| "่ทๅๆ็ซ ๅ
ๆฐๆฎ" | --json | ๅ
ๅซๆ ้ขใไฝ่
ใๆฅๆ็ญ |
| "ๅชๅๆ ้ข" | --property title | ็ฒพๅๆๅ |
| "้่ฆๅฎๆดๆฐๆฎ" | --json | ๅ
ๅซๅๅง HTML ๅ Markdown |
ๅบ็กๆๅ
npx defuddle parse "https://example.com/article" --markdown
npx defuddle parse "https://example.com/article" --json
npx defuddle parse "https://example.com/article" --markdown --output ./output/article.md
ๆน้ๅค็
urls=(
"https://site.com/article-1"
"https://site.com/article-2"
"https://site.com/article-3"
)
for url in "${urls[@]}"; do
slug=$(echo "$url" | sed 's/[^a-zA-Z0-9]/-/g')
npx defuddle parse "$url" --markdown --output "./output/${slug}.md"
done
Phase 3: Post-Processing
่ดจ้ๆฃๆฅ
if [[ -s output.md && $(wc -c < output.md) -gt 100 ]]; then
echo "Extraction successful"
else
echo "Extraction failed or content too short"
fi
ไธๅ
ถไปๅทฅๅ
ท้
ๅ
npx defuddle parse https://example.com --markdown | glow -
npx defuddle parse https://example.com --markdown | wc -w
Usage Examples
็คบไพ 1: ๅบ็กๆ็ซ ๆๅ
็จๆท: "ๆๅ่ฟ็ฏๆ็ซ https://blog.example.com/my-post"
ๆง่ก:
npx defuddle parse "https://blog.example.com/my-post" --markdown --output ./defuddle/my-post.md
่พๅบ: ./defuddle/my-post.md (ๅนฒๅ็ Markdown)
็คบไพ 2: ่ทๅๅ
ๆฐๆฎ
็จๆท: "่ทๅ่ฟไธช็ฝ้กต็ๆ ้ขๅไฝ่
https://news.example.com/story"
ๆง่ก:
npx defuddle parse "https://news.example.com/story" --json | jq '{title, author, date}'
่พๅบ:
{
"title": "Story Title",
"author": "Jane Doe",
"date": "2024-03-14"
}
็คบไพ 3: ๆน้ๆ็ซ ๆๅ
็จๆท: "ๆๅ่ฟ 5 ไธช้พๆฅ็ๅ
ๅฎน"
ๆง่ก:
urls=("url1" "url2" "url3" "url4" "url5")
for url in "${urls[@]}"; do
npx defuddle parse "$url" --markdown --output "./defuddle/$(basename $url).md"
done
็คบไพ 4: ้
ๅ็ ็ฉถๆต็จ
mofa-research-2.0: ๅ็ฐๆ็ซ URL
โ
mofa-defuddle: ๆๅๆ็ซ ๅ
ๅฎน
โ
mofa-research-2.0: ๅๆๆๅ็ๅ
ๅฎน
โ
็ๆ็ปผๅๆฅๅ
Configuration
็ฏๅขๅ้
export DEFUDDLE_OUTPUT_DIR="./extracted"
export DEFUDDLE_TIMEOUT="30000"
Error Handling
ๅธธ่ง้่ฏฏ
| ้่ฏฏ | ๅๅ | ่งฃๅณๆนๆก |
|---|
fetch failed | ็ฝ็ป้ฎ้ขๆๅ็ฌ | ๅฐ่ฏๅ
ถไปๅทฅๅ
ทๅฆ mofa-firecrawl |
parse failed | ้กต้ข็ปๆไธๆ ๅ | ๆฃๆฅๆฏๅฆไธบๅ้กตๅบ็จ (SPA) |
content empty | ๆๅๅคฑ่ดฅ | ้กต้ขๅฏ่ฝ้่ฆ JavaScript ๆธฒๆ |
timeout | ่ฏทๆฑ่ถ
ๆถ | ๆฃๆฅ็ฝ็ปๆๅขๅ ่ถ
ๆถๆถ้ด |
้็บง็ญ็ฅ
defuddle_extract() {
url=$1
output=$2
if npx defuddle parse "$url" --markdown --output "$output" 2>/dev/null; then
echo "Defuddle succeeded"
return 0
fi
echo "Defuddle failed, trying firecrawl..."
firecrawl "$url" -o "$output"
}
Output Requirements
ๅฟ
้กป็ๆ็ๆไปถ
./defuddle/{task-slug}/
โโโ content.md # ๆๅ็ Markdown ๅ
ๅฎน
โโโ metadata.json # ๅ
ๆฐๆฎ๏ผๅฆๆ็จ --json๏ผ
โโโ report.md # ๆง่กๆฅๅ๏ผๅฏ้๏ผ
่ดจ้ๆฃๆฅๆธ
ๅ
Related Skills
mofa-research-2.0
ๆทฑๅบฆ็ ็ฉถ็ฎก้ใ
็ปๅไฝฟ็จๆจกๅผ:
mofa-research-2.0: ๆ็ดขๅ็ฐๆ็ซ URL
โ
mofa-defuddle: ๆน้ๆๅๆ็ซ ๅ
ๅฎน
โ
mofa-research-2.0: ๅๆๆๅ็ๅ
ๅฎน โ ็ ็ฉถๆฅๅ
mofa-firecrawl
้ซ็บง็ฝ้กต็ฌๅๅทฅๅ
ทใ
ๅบๅซ:
- mofa-defuddle: ่ฝป้ๅฟซ้๏ผไธ้จๆๅๆ็ซ ๅ
ๅฎน๏ผ้ๅๅทฒ็ฅ URL
- mofa-firecrawl: ๅ่ฝๅ
จ้ข๏ผๆฏๆๆด็ซ็ฌๅใๆ็ดขใๆต่งๅจ่ชๅจๅ
็ปๅไฝฟ็จ:
mofa-firecrawl: ๅ็ฐ็ฎๆ ๆ็ซ URL
โ
mofa-defuddle: ๅฟซ้ๆๅๆ็ซ ๅ
ๅฎน
โ
็ปผๅๅๆ
mofa-crawler
Cloudflare Browser Rendering ็ฌๅใ
ๅบๅซ:
- mofa-defuddle: ็บฏๅ
ๅฎนๆๅ๏ผ่พๅบ Markdown
- mofa-crawler: ๅ
จ็ซ็ฌๅ๏ผ่พๅบๅค้กต้ข
mofa-pinchtab
่ฝป้็บงๆต่งๅจๆงๅถใ
็ปๅไฝฟ็จ:
mofa-pinchtab: ่ทๅ้กต้ข HTML
โ
mofa-defuddle: ๆๅๅนฒๅๅ
ๅฎน
โ
ๅๆๅค็
Comparison: Content Extraction Tools
| ๅทฅๅ
ท | ้ๅบฆ | ่พๅบๆ ผๅผ | ๆไฝณๅบๆฏ | ไพ่ต |
|---|
| defuddle | ๅฟซ | Markdown/JSON | ๆ็ซ ๅ
ๅฎนๆๅ | Node.js |
| firecrawl | ไธญ | Markdown/JSON/HTML | ๅคง่งๆจก็ฌๅใๆ็ดข | Firecrawl API |
| crawler | ไธญ | Markdown/JSON/HTML | Cloudflare ็ๆ | CF API |
| pinchtab | ๅฟซ | Text | Token ้ซๆๆๅ | ๆฌๅฐ Chrome |
| readability | ๅฟซ | HTML | ๆต่งๅจๅ
็ฝฎ | ๆ |
Notes
- Defuddle ไธไธบๆ็ซ ็ฑป้กต้ขไผๅ๏ผๅฏนๅ่กจ้กตใ้ฆ้กตๆๆๅฏ่ฝไธไฝณ
- ๆไบ็ฝ็ซๆๅ็ฌๆบๅถ๏ผๅฏ่ฝ้่ฆ้
ๅ mofa-firecrawl ๆ mofa-verge-browser ไฝฟ็จ
- ๆๅ่ดจ้ๅๅณไบ็ฝ้กต็ปๆ๏ผๆ ๅๅๅฎข/ๆฐ้ป็ฝ็ซๆๆๆไฝณ