Skip to content

Instantly share code, notes, and snippets.

@petenelson
Last active May 3, 2017 21:53
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 petenelson/1e6b19aa5d1702e30315e8bc352abc39 to your computer and use it in GitHub Desktop.
Save petenelson/1e6b19aa5d1702e30315e8bc352abc39 to your computer and use it in GitHub Desktop.
Get paragraphs of garbage content from baconipsum.com
#!/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