Name : perl-ACME-QuoteDB
| |
Version : 0.1.2
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 9.7
| Date : 2019-06-13 03:46:41
|
Group : Development/Libraries/Perl
| Source RPM : perl-ACME-QuoteDB-0.1.2-9.7.src.rpm
|
Size : 0.16 MB
| |
Packager : (none)
| |
Summary : API implements CRUD for a Collection of Quotes (adages/proverbs/sayings/[cut]
|
Description :
This module 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)
Originally, 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)
Supported actions include: (CRUD) * 1 Create
* Adding quote(s) * \'Batch\' Loading quotes from a file (stream, other database, etc)
* 1 Read
* Displaying a single quote, random or based on some criteria * Displaying multiple quotes, based on some criteria * Displaying a specific number of quotes, based on some search criteria
* 1 Update
* Update an existing quote
* 1 Delete
* Remove an existing quote
Examples of Read my $sq = ACME::QuoteDB->new;
print $sq->get_quote({Category => [qw(Haloween Humor)]});
print AATT{$sq->get_quotes({AttrName => \'comic book guy\'})};
$sq->get_quotes({Rating => \'7.0\'});
$sq->get_quotes_contain({Contain => \'til the cow\'});
Examples of Create (See ACME::QuoteDB::LoadDB for batch loading)
my $id_of_added = $sq->add_quote({ Quote => \'Hi, I\'m Peter,...\", AttrName => \'Peter Griffin\', Source => \'Family American Dad Guy\', Rating => \'1.6\', Category => \'TV Humor\', });
Example of Update my $quote_id = $sq->get_quote_id({Quote => \'Hi, I\'m Peter,...\"});
$sq->update_quote({ QuoteId => $quote_id, Quote => \'Hi, I\'m Peter, and your not!\', AttrName => \'Peter Griffin\', Source => \'Family Guy\', Rating => \'5.7\', Category => [qw(TV Humor Crude Adolescent)] });
Example of Delete $sq->delete_quote({QuoteId => $quote_id});
* record format
One full quote database record currently consits of 5 fields:
Quote, AttrName, Source, Rating, Category
Quote => \'the quote desired\' # mandatory AttrName => \'who said it\' # mandatory Source => \'where was it said\' Rating => \'how you rate the quote/if at all\', Category => \'what category is the quote in\',
For example:
Quote => \'Hi, I\'m Peter,...\", AttrName => \'Peter Griffin\', Source => \'Family Guy\', Rating => \'8.6\', Category => \'TV Humor\',
* * NOTE: In order for this module to be useful one has to load some quotes to the database. Hey, just once though :) (see below - Loading Quotes)
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-A/openSUSE_Tumbleweed/noarch |