NAME

App::Zapzi::Articles - routines to access Zapzi articles

VERSION

version 0.015

DESCRIPTION

These routines allow access to Zapzi articles via the database.

METHODS

get_articles(folder)

Returns a resultset of articles that are in $folder.

get_article(id)

Returns the resultset for the article identified by id.

articles_summary(folder)

Return a summary of articles in folder as a list of articles, each item being a hash ref with keys id, created, source, text and title.

add_article(args)

Adds a new article. args is a hash that must contain

  • title - title of the article

  • source - source, eg file or URL, of the article

  • folder - name of the folder to store it in

  • text - text of the article

The routine will croak if the wrong args are provided, if the folder does not exist or if the article can't be created in the database.

move_article(id, new_folder)

Move the given article to folder new_folder. Will croak if the folder or article does not exist.

delete_article(id)

Deletes article id if it exists. Returns the DB result status for the deletion.

export_article(id)

Returns the text of article id if it exists, else undef. Text will be wrapped in a HTML header so it can be viewed separately.

AUTHOR

Rupert Lane <rupert@rupert-lane.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Rupert Lane.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.