ACME::QuoteDB

API implements CRUD for a Collection of Quotes (adages/proverbs/sayings/epigrams, etc)
Download

ACME::QuoteDB Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • David Wright
  • Publisher web site:
  • http://search.cpan.org/~dvwright/

ACME::QuoteDB Tags


ACME::QuoteDB Description

API implements CRUD for a Collection of Quotes (adages/proverbs/sayings/epigrams, etc) ACME::QuoteDB is a Perl module that provides an easy to use programmitic interface to a database (sqlite3 or mysql) of 'quotes'. (any content really, that can fit into our "defined format")For simplicty you can think of it as a modern fancy perl version of fortune (with a management interface, remote database connection support, plus additional features and some not (yet) supported).Developer commentsOriginally, this module was designed for a collection of quotes from a well known TV show, once I became aware that distributing it as such would be copyright infringement, I generalized the module, so it can be loaded with 'any' content. (in the quote-ish format).SYNOPSISEasy access to a collection of quotes (the 'Read' part)As quick one liner: # randomly display one quote from all available. (like motd, 'fortune') perl -MACME::QuoteDB -le 'print quote()' # Say you have populated your quotes database with some quotes from # 'The Simpsons' # randomly display one quote from all available for person 'Ralph' perl -MACME::QuoteDB -le 'print quote({AttrName => "ralph"})' # example of output Prinskipper Skippel... Primdable Skimpsker... I found something! -- Ralph Wiggum # get 1 quote, only using these categories (you have defined) perl -MACME::QuoteDB -le 'print quote({Category => })'In a script/module, OO usage: use ACME::QuoteDB; my $sq = ACME::QuoteDB->new; # get random quote from any attribution print $sq->get_quote; # get random quote from specified attribution print $sq->get_quote({AttrName => 'chief wiggum'}); # example of output I hope this has taught you kids a lesson: kids never learn. -- Chief Wiggum # get all quotes from one source print @{$sq->get_quotes({Source => 'THE SimPSoNs'})}; # is case insensitive # get 2 quotes, with a low rating that contain a specific string print @{$sq->get_quotes_contain({ Contain => 'til the cow', Rating => '1-5', Limit => 2 })}; # get 5 quotes from given source print @{$sq->get_quotes({Source => 'The Simpsons', Limit => 5 })}; # list all sources print $sq->list_attr_sources; # list all categories print $sq->list_categories; Requirements: · Perl


ACME::QuoteDB Related Software