Tuesday, February 1, 2011

command line dump of Wikipedia pages.

However here is a way to do a command line dump of Wikipedia pages.

First install WWW::Wikipedia perl module. How you do it is your
choice. One possibility is this:

# cpan WWW::Wikipedia

or

# perl -MCPAN -e 'install WWW::Wikipedia;'

Once you do that just run this:

--------------begin script----------
 use WWW::Wikipedia;
       $text = shift;
        my $wiki = WWW::Wikipedia->new();
          my $entry = $wiki->search( $text );
          print $entry->fulltext();

-----------end script---------------

Run it like this:

$ perl w.pl india

to find out about India.


I think so this will help to veiw the wikipedia in terminal mode.

No comments:

Post a Comment