mirror of
https://github.com/srid/nixos-config.git
synced 2025-12-26 15:04:59 +08:00
ae: download first
This commit is contained in:
parent
fa94fe504f
commit
4897572347
1 changed files with 7 additions and 1 deletions
|
|
@ -20,8 +20,11 @@ User wants to:
|
|||
## Workflow
|
||||
|
||||
```bash
|
||||
# Download HTML
|
||||
curl -L "$URL" > temp.html
|
||||
|
||||
# Extract article
|
||||
reader "$URL" > temp.txt
|
||||
reader temp.html > temp.txt
|
||||
|
||||
# Get title from first line
|
||||
TITLE=$(head -n 1 temp.txt | sed 's/^# //')
|
||||
|
|
@ -32,6 +35,9 @@ FILENAME=$(echo "$TITLE" | tr '/:?"<>|' '-' | cut -c 1-80 | sed 's/ *$//')".txt"
|
|||
# Save
|
||||
mv temp.txt "$FILENAME"
|
||||
|
||||
# Clean up
|
||||
rm temp.html
|
||||
|
||||
# Show preview
|
||||
echo "✓ Saved: $FILENAME"
|
||||
head -n 10 "$FILENAME"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue