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
#!/usr/bin/php | |
<?php | |
/** | |
* Bacon ipsum PHP-CLI script | |
* | |
* Generates sentences or paragraphs from baconipsum.com | |
* | |
* @version 1.0.1 | |
* @author Thomas Ward III <[email protected]> | |
*/ |
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
#!/usr/bin/perl | |
use HTTP::Tiny; | |
use JSON; | |
use Getopt::Long; | |
use Config::Simple ('-lc'); | |
use File::HomeDir; | |
my $BASE_URL = "http://baconipsum.com/api/?"; | |
my $paras = 0; |
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
# Custom ConfigParser class | |
# Perhaps the defaults should be passed into this class for the purposes of others using this, but is scrubbed code from something | |
# I'll be using for my own purposes, and I wanted config stuff self-contained, and I'm still new to this so meh :) | |
import ConfigParser | |
class CustomConfigParser(ConfigParser.ConfigParser): | |
def __init__(self): | |
ConfigParser.ConfigParser.__init__(self) | |
# Change as necessary for your needs. Define all potential keys and their defaults here |