David Leadbeater > Text-Summary-MediaWiki-0.02 > Text::Summary::MediaWiki

Download:
Text-Summary-MediaWiki-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Text::Summary::MediaWiki - Produce a short summary from MediaWiki markup

SYNOPSIS ^

    use Text::Summary::MediaWiki;

    my $s = Text::Summary::MediaWiki->new(
      url => "http://en.wikipedia.org/wiki/", # Trailing / is required
      get => sub {
        my($url) = @_;
        # return markup of page at URL
      });

    print $s->get("Perl");

DESCRIPTION ^

Produces short summaries from MediaWiki markup. This has been mostly tested with Wikipedia but this should work for any wiki using MediaWiki markup.

Note that making requests to Wikipedia for each page is considered rather rude, if you need a high query volume use a local database dump (I use Parse::MediaWikiDump).

METHODS ^

new

The new method takes a parameter hash containing the following:

get

Given the name of an article fetches it and generates a summary.

If called in array context returns the summary and the URL it can be found at.

format

Generates a summary from text in MediaWiki format.

AUTHOR ^

David Leadbeater <dgl at dgl.cx>

COPYRIGHT & LICENSE ^

Copyright 2006 David Leadbeater, all rights reserved.

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

syntax highlighting: