| Next: Yawns::Articles | Previous: Yawns::Adverts | [Table of Contents] |
Yawns::Article - A module for working with a single article.
#!/usr/bin/perl -w
use Yawns::Article;
use strict;
my $article = Yawns::Article->new( id => 33 );
my $count = $article->getReadCount();
$article->increaseReadCount();
This module contains code for dealing with a single article.
Create a new instance of this object.
Return the actual article. This returns a hash containing all the relevant details of an article, along with the titles and IDs of the next and previous articles.
Edit an article:
my $article = Yawns::Article->new( id => 30 );
$article->edit( title => "New title",
author => "Author",
body => "Body text here" );
Create a new article:
my $article = Yawns::Article->new( id => 30 );
$article->create( title => "New title",
author => "Author",
body => "Body text here" );
Delete the given article.
Return the number of times this article was read.
Add one to the number of times the given article was read.
Get the title of this article.
Find and return the lead text for a given article.
Add a related link to this particular article.
Delete either a single related link, or all the related links on an article.
Return the list of related article links.
Count the words in the given text
Clean any cached content we might have.
Steve Kemp
http://www.steve.org.uk/
Copyright (c) 2005,2006 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.