WWW::W...::Entry(3pm)

πŸ“¦
version 2.05 Β· 2 versions
  • 2.05 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 2.05 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– WWW::W...::Entry πŸ’–

okay bestie, so this is the manual page for WWW::W...::Entry(3pm) β€” a User Contributed Perl Documentation page, and honestly? she's giving very useful library energy. buckle up πŸŽ€


✨ NAME ✨

WWW::Wikipedia::Entry β€” a whole class for representing a Wikipedia Entry, no cap πŸ’…


✨ SYNOPSIS ✨

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

my $entry_es = $entry->language( 'es' );
print $entry_es->text();

like, that's it. that's the whole vibe. you search, you get an entry, you print the text. iconic behavior 🌸


✨ DESCRIPTION ✨

so here's the tea πŸ“: WWW::Wikipedia::Entry objects are usually created using the search() method on a WWW::Wikipedia object, when you go searching for a term. once you've got yourself an entry object, you can pull little pieces of info out of it using the methods listed below. she's basically a little Wikipedia-info vending machine and we love her for it πŸ’œ


✨ METHODS ✨

πŸ¦‹ new()

ngl you probably won't touch this one. it's the constructor that gets called behind the scenes with the correct arguments by WWW::Wikipedia::search(). she works backstage, main character energy but offstage 😌

πŸ¦‹ text()

the brief text for the entry. this gives you the first paragraph of text β€” basically everything up to the first heading. ordinarily, this is what you want to use, fr fr. and when there doesn't appear to be any summary text? you get handed the fulltext instead. generous queen πŸ’–

if text() returns nothing, you're probably looking at a disambiguation entry, and you should use related() to look up more specific entries. don't panic, just pivot bestie πŸ™ˆ

πŸ¦‹ text_basic()

the same as text(), but not run through Text::Autoformat. raw and unfiltered, periodt ✨

πŸ¦‹ fulltext()

returns the full text for the entry β€” and she can be extensive. like, essay-length extensive 😭

πŸ¦‹ fulltext_basic()

the same as fulltext(), but not run through Text::Autoformat. same energy, different formatting πŸ’…

πŸ¦‹ title()

returns a title of the entry. just the title. short king πŸ‘‘

returns a list of terms in the wikipedia that are mentioned in the entry text. it's giving "you might also like" 🌈

πŸ¦‹ categories()

returns a list of categories which the entry is part of. so like, Perl is part of the Programming languages category. slay πŸ’œ

πŸ¦‹ headings()

returns a list of headings used in the entry. the table of contents, basically πŸŽ€

πŸ¦‹ raw()

returns the raw wikitext for the entry. no makeup, no filter, just vibes 🧚

πŸ¦‹ language()

with no parameters, it returns the current language of the entry. if you specify a two-letter language code, it returns the same entry in that language β€” if it's available, that is. iykyk 🌸

NOTE: 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. so like… manage your expectations bestie, she's doing her best 😭

πŸ¦‹ languages()

returns an array of two letter language codes denoting the languages in which this entry is available. a little array of possibilities 🫢


✨ AUTHORS ✨

  • Ed Summers <ehs@pobox.com>
  • Brian Cassidy <bricas@cpan.org>

two legends, we stan πŸ‘‘βœ¨


Copyright 2003-2017 by Ed Summers

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


and that's the whole page bestie!! πŸ’– this was WWW::W...::Entry(3pm) from perl v5.34.0, dated 2022-06-28 β€” go forth and extract wikipedia info like the icon you are πŸŽ€πŸ’…πŸŒŸ

πŸ“¦ where this page comes from