Ed Summers > WWW-Wikipedia-1.2 > WWW::Wikipedia::Entry

Download:
WWW-Wikipedia-1.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source   Latest Release: WWW-Wikipedia-1.96

NAME ^

WWW::Wikipedia::Entry - A class for representing a Wikipedia Entry

SYNOPSIS ^

    my $wiki = WWW::Wikipedia->new();
    my $entry = $wiki->search( 'Perl' );
    print $entry->text();

DESCRIPTION ^

WWW::Wikipedia::Entry objects are usually created using the search() method on a WWW::Wikipedia object to search for a term. Once you've got an entry object you can then extract pieces of information from the entry using the following methods.

METHODS ^

new()

You probably won't use this one, it's the constructor that is called behind the scenes with the correct arguments by WWW::Wikipedia::search().

text()

The brief text for the entry. This will provide the first paragraph of text; basically everything up to the first heading. Ordinarily this will be what you want to use.

If text() returns nothing then you probably are looking at a disambiguation entry, and should use related() to lookup more specific entries.

fulltext()

Returns the full text for the entry, which can be extensive.

related()

Returns a list of terms in the wikipedia that are mentioned in the entry text.

categories()

Returns a list of categories which the entry is part of. So Perl is part of the Programming languages category.

headings()

Returns a list of headings used in the entry.

raw()

Returns the raw wikitext for the entry.

AUTHORS ^