Last active
January 24, 2023 11:26
-
-
Save miku/9c840a7460eae95ec7889b3c52730808 to your computer and use it in GitHub Desktop.
lvz is a function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lvz () | |
{ | |
# go install github.com/ericchiang/pup@latest | |
for cmd in curl jq pup; | |
do | |
if [ ! $(command -v $cmd) ]; then | |
echo "$cmd required"; | |
return; | |
fi; | |
done; | |
if [ -z "$1" ]; then | |
echo "usage: lvz URL"; | |
else | |
curl -sL "$1" | pup 'script[type="application/ld+json"] text{}' | grep --color=auto NewsArticle | jq -rc .articleBody | fold -s | less -F; | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment