/usr/bin/wikipedia is in libwww-wikipedia-perl 2.00-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | #!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0; # not running under some shell
=head1 NAME
wikipedia - lookup an entry in the wikipedia
=head1 SYNOPSIS
% wikipedia [-l lang] perl
=head1 DESCRIPTION
wikipedia is a command line tool for looking up a topic in the wikipedia
and printing it to STDOUT. Useful if you spend a lot of time in a shell
and don't want to fire up a web browser to see what something is.
=head1 AUTHORS
=over 4
=item * Slaven Rezic <slaven@rezic.de>
=back
=cut
use strict;
use WWW::Wikipedia;
use Text::Autoformat;
use Pod::Usage;
use Getopt::Std;
my %options;
getopts( 'l:', \%options );
my $term = shift;
pod2usage( { verbose => 1 } ) if !defined( $term );
my $wiki = WWW::Wikipedia->new( language => $options{ l } || 'en' );
my $entry = $wiki->search( $term );
## use a pager if we can
eval( 'use IO::Page' );
if ( $entry ) {
my $text = $entry->text();
if ( $text ) { print $text; }
else {
print "Specific entry not found, see also:\n";
foreach ( $entry->related() ) { print " - $_\n"; }
}
}
else { print qq("$term" not found in wikipedia\n) }
|