Last active
May 3, 2017 21:53
-
-
Save petenelson/1e6b19aa5d1702e30315e8bc352abc39 to your computer and use it in GitHub Desktop.
Get paragraphs of garbage content from baconipsum.com
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
#!/bin/bash | |
##################### | |
# bacon.sh | |
# | |
# Client to get paragraphs of garbage content from baconipsum.com | |
# | |
# usage: | |
# bacon.sh <paragraph-count> | |
##################### | |
if [ -z "$1" ]; then | |
echo "usage: bacon.sh <paragraph-count>" | |
else | |
curl -s 'https://baconipsum.com/?paras='"$1"'&type=all-meat' | grep 'div class="anyipsum-output"' | sed 's/<\/div>.*$//g;s/<\/p>/\n/g;s/^[ \t]*//g;s/<[\/]*[A-Za-z0-9 "-=]*[\/]*>//g' | grep -v '^[ \t]*$' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment