Skip to main content Skills Marktplatz Entdecken und erkunden Sie KI-Skills, die von der Community erstellt wurden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Prompt kopierenPrompt-Details anzeigen Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
npx skills add https://github.com/michalparkola/tapestry-skills --skill article-extractorDer Befehl bleibt in einer Zeile. Scrollen Sie horizontal, um ihn vor dem Kopieren vollständig zu prüfen.
Sie bevorzugen eine lokale Kopie? Laden Sie die Dateien herunter, die SkillsMP derzeit vorliegen.
ZIP herunterladen Herunterladen... Mehr aus diesem Repository
Verwandte Berufe SOC
Basierend auf der SOC-Berufsklassifikation
name article-extractor description Extract clean article content from URLs (blog posts, articles, tutorials) and save as readable text. Use when user wants to download, extract, or save an article/blog post from a URL without ads, navigation, or clutter. allowed-tools Bash,Write
Article Extractor
This skill extracts the main content from web articles and blog posts, removing navigation, ads, newsletter signups, and other clutter. Saves clean, readable text.
When to Use This Skill
Activate when the user:
Provides an article/blog URL and wants the text content
Asks to "download this article"
Wants to "extract the content from [URL]"
Asks to "save this blog post as text"
Needs clean article text without distractions
How It Works
Priority Order:
Check if tools are installed (reader or trafilatura)
Download and extract article using best available tool
Clean up the content (remove extra whitespace, format properly)
Save to file with article title as filename
Confirm location and show preview
Installation Check
Check for article extraction tools in this order:
Option 1: reader (Recommended - Mozilla's Readability)
command -v reader
If not installed:
npm install -g @mozilla/readability-cli
npm install -g reader-cli
Option 2: trafilatura (Python-based, very good)
Option 3: Fallback (curl + simple parsing) If no tools available, use basic curl + text extraction (less reliable but works)
Extraction Methods
Method 1: Using reader (Best for most articles)
reader "URL" > article.txt
Based on Mozilla's Readability algorithm
Excellent at removing clutter
Preserves article structure
Method 2: Using trafilatura (Best for blogs/news)
trafilatura --URL "URL" --output-format txt > article.txt
trafilatura --URL "URL" --output-format txt --no-comments --no-tables > article.txt
Very accurate extraction
Good with various site structures
Handles multiple languages
--no-comments: Skip comment sections
--no-tables: Skip data tables
--precision: Favor precision over recall
--recall: Extract more content (may include some noise)
Method 3: Fallback (curl + basic parsing)
curl -s "URL" | python3 -c "
from html.parser import HTMLParser
import sys
class ArticleExtractor(HTMLParser):
def __init__(self):
super().__init__()
self.in_content = False
self.content = []
self.skip_tags = {'script', 'style', 'nav', 'header', 'footer', 'aside'}
self.current_tag = None
def handle_starttag(self, tag, attrs):
if tag not in self.skip_tags:
if tag in {'p', 'article', 'main', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'}:
self.in_content = True
self.current_tag = tag
def handle_data(self, data):
if self.in_content and data.strip():
self.content.append(data.strip())
def get_content(self):
return '\n\n'.join(self.content)
parser = ArticleExtractor()
parser.feed(sys.stdin.read())
print(parser.get_content())
" > article.txt
Note: This is less reliable but works without dependencies.
Getting Article Title Extract title for filename:
Using reader:
TITLE=$(reader "URL" | head -n 1 | sed 's/^# //' )
Using trafilatura:
TITLE=$(trafilatura --URL "URL" --json | python3 -c "import json, sys; print(json.load(sys.stdin)['title'])" )
Using curl (fallback): TITLE=$(curl -s "URL" | grep -oP '<title>\K[^<]+' | sed 's/ - .*//' | sed 's/ | .*//' )
Filename Creation Clean title for filesystem:
TITLE="Article Title from Website"
FILENAME=$(echo "$TITLE " | tr '/' '-' | tr ':' '-' | tr '?' '' | tr '"' '' | tr '<' '' | tr '>' '' | tr '|' '-' | cut -c 1-100 | sed 's/ *$//' )
FILENAME="${FILENAME} .txt"
Complete Workflow ARTICLE_URL="https://example.com/article"
if command -v reader &> /dev/null; then
TOOL="reader"
echo "Using reader (Mozilla Readability)"
elif command -v trafilatura &> /dev/null; then
TOOL="trafilatura"
echo "Using trafilatura"
else
TOOL="fallback"
echo "Using fallback method (may be less accurate)"
fi
case $TOOL in
reader)
reader "$ARTICLE_URL " > temp_article.txt
TITLE=$(head -n 1 temp_article.txt | sed 's/^# //' )
;;
trafilatura)
METADATA=$(trafilatura --URL "$ARTICLE_URL " --json)
TITLE=$(echo "$METADATA " | python3 -c "import json, sys; print(json.load(sys.stdin).get('title', 'Article'))" )
trafilatura --URL "$ARTICLE_URL " --output-format txt --no-comments > temp_article.txt
;;
fallback)
TITLE=$(curl -s "$ARTICLE_URL " | grep -oP '<title>\K[^<]+' | head -n 1)
TITLE=${TITLE%% - *}
TITLE=${TITLE%% | *}
curl -s "$ARTICLE_URL " | python3 -c "
from html.parser import HTMLParser
import sys
class ArticleExtractor(HTMLParser):
def __init__(self):
super().__init__()
self.in_content = False
self.content = []
self.skip_tags = {'script', 'style', 'nav', 'header', 'footer', 'aside', 'form'}
def handle_starttag(self, tag, attrs):
if tag not in self.skip_tags:
if tag in {'p', 'article', 'main'}:
self.in_content = True
if tag in {'h1', 'h2', 'h3'}:
self.content.append('\n')
def handle_data(self, data):
if self.in_content and data.strip():
self.content.append(data.strip())
def get_content(self):
return '\n\n'.join(self.content)
parser = ArticleExtractor()
parser.feed(sys.stdin.read())
print(parser.get_content())
" > temp_article.txt
;;
esac
FILENAME=$(echo "$TITLE " | tr '/' '-' | tr ':' '-' | tr '?' '' | tr '"' '' | tr '<>' '' | tr '|' '-' | cut -c 1-80 | sed 's/ *$//' | sed 's/^ *//' )
FILENAME="${FILENAME} .txt"
mv temp_article.txt "$FILENAME "
echo "✓ Extracted article: $TITLE "
echo "✓ Saved to: $FILENAME "
echo ""
echo "Preview (first 10 lines):"
head -n 10 "$FILENAME "
Error Handling
Common Issues
Try alternate tool (reader → trafilatura → fallback)
Offer to install: "Install reader with: npm install -g reader-cli"
2. Paywall or login required
Extraction tools may fail
Inform user: "This article requires authentication. Cannot extract."
Check URL format
Try with and without redirects
Site may use heavy JavaScript
Try fallback method
Inform user if extraction fails
5. Special characters in title
Clean title for filesystem
Remove: /, :, ?, ", <, >, |
Replace with - or remove
Output Format
Saved File Contains:
Article title (if available)
Author (if available from tool)
Main article text
Section headings
No navigation, ads, or clutter
What Gets Removed:
Navigation menus
Ads and promotional content
Newsletter signup forms
Related articles sidebars
Comment sections (optional)
Social media buttons
Cookie notices
Tips for Best Results 1. Use reader for most articles
Best all-around tool
Based on Firefox Reader View
Works on most news sites and blogs
Academic articles
News sites
Blogs with complex layouts
Non-English content
3. Fallback method limitations:
May include some noise
Less accurate paragraph detection
Better than nothing for simple sites
4. Check extraction quality:
Always show preview to user
Ask if it looks correct
Offer to try different tool if needed
Example Usage
reader "https://example.com/article" > temp.txt
TITLE=$(head -n 1 temp.txt | sed 's/^# //' )
FILENAME="$(echo "$TITLE " | tr '/' '-') .txt"
mv temp.txt "$FILENAME "
echo "✓ Saved to: $FILENAME "
if ! reader "$URL " > temp.txt 2>/dev/null; then
if command -v trafilatura &> /dev/null; then
trafilatura --URL "$URL " --output-format txt > temp.txt
else
echo "Error: Could not extract article. Install reader or trafilatura."
exit 1
fi
fi
Best Practices
✅ Always show preview after extraction (first 10 lines)
✅ Verify extraction succeeded before saving
✅ Clean filename for filesystem compatibility
✅ Try fallback method if primary fails
✅ Inform user which tool was used
✅ Keep filename length reasonable (< 100 chars)
After Extraction
"✓ Extracted: [Article Title]"
"✓ Saved to: [filename]"
Show preview (first 10-15 lines)
File size and location
"Would you like me to also create a Ship-Learn-Next plan from this?" (if using ship-learn-next skill)
"Should I extract another article?"