Skip to content

Instantly share code, notes, and snippets.

@miku
Last active January 24, 2023 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miku/9c840a7460eae95ec7889b3c52730808 to your computer and use it in GitHub Desktop.
Save miku/9c840a7460eae95ec7889b3c52730808 to your computer and use it in GitHub Desktop.
lvz is a function
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