.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "WWW::Wikipedia::Entry 3pm" .TH WWW::Wikipedia::Entry 3pm "2017-11-12" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" WWW::Wikipedia::Entry \- A class for representing a Wikipedia Entry .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& my $wiki = WWW::Wikipedia\->new(); \& my $entry = $wiki\->search( \*(AqPerl\*(Aq ); \& print $entry\->text(); \& \& my $entry_es = $entry\->language( \*(Aqes\*(Aq ); \& print $entry_es\->text(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" WWW::Wikipedia::Entry objects are usually created using the \fIsearch()\fR 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. .SH "METHODS" .IX Header "METHODS" .SS "\fInew()\fP" .IX Subsection "new()" You probably won't use this one, it's the constructor that is called behind the scenes with the correct arguments by \fIWWW::Wikipedia::search()\fR. .SS "\fItext()\fP" .IX Subsection "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. When there doesn't appear to be summary text you will be returned the fulltext instead. .PP If \fItext()\fR returns nothing then you probably are looking at a disambiguation entry, and should use \fIrelated()\fR to lookup more specific entries. .SS "\fItext_basic()\fP" .IX Subsection "text_basic()" The same as \f(CW\*(C`text()\*(C'\fR, but not run through Text::Autoformat. .SS "\fIfulltext()\fP" .IX Subsection "fulltext()" Returns the full text for the entry, which can be extensive. .SS "\fIfulltext_basic()\fP" .IX Subsection "fulltext_basic()" The same as \f(CW\*(C`fulltext()\*(C'\fR, but not run through Text::Autoformat. .SS "\fItitle()\fP" .IX Subsection "title()" Returns a title of the entry. .SS "\fIrelated()\fP" .IX Subsection "related()" Returns a list of terms in the wikipedia that are mentioned in the entry text. .SS "\fIcategories()\fP" .IX Subsection "categories()" Returns a list of categories which the entry is part of. So Perl is part of the Programming languages category. .SS "\fIheadings()\fP" .IX Subsection "headings()" Returns a list of headings used in the entry. .SS "\fIraw()\fP" .IX Subsection "raw()" Returns the raw wikitext for the entry. .SS "\fIlanguage()\fP" .IX Subsection "language()" With no parameters, it will return the current language of the entry. By specifying a two-letter language code, it will return the same entry in that language, if available. .PP \&\s-1NOTE:\s0 Generally, Wikipedia no longer uses language tags stored on a page. Rather, languages are driven from wikidata, which this module does not query. You will find for most pages there are no other languages available, based on how this method currently works.. .SS "\fIlanguages()\fP" .IX Subsection "languages()" Returns an array of two letter language codes denoting the languages in which this entry is available. .SH "AUTHORS" .IX Header "AUTHORS" Ed Summers .PP Brian Cassidy .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2003\-2017 by Ed Summers .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.