=encoding UTF-8

=head1 NAME

WWW::WWWJDIC - information about online Japanese dictionary WWWJDIC


    use utf8;
    use WWW::WWWJDIC;
    my $wj = WWW::WWWJDIC->new (mirror => 'usa');
    print $wj->lookup_url ('日本'), "\n";

produces output


(This example is included as L<F<synopsis.pl>|https://fastapi.metacpan.org/source/BKB/WWW-WWWJDIC-0.005/examples/synopsis.pl> in the distribution.)

=head1 VERSION

This documents WWW::WWWJDIC version 0.005
corresponding to git commit L<d12f085ac5039c3b3fec766b36c7995a022ce383|https://github.com/benkasminbullock/WWW-WWWJDIC/commit/d12f085ac5039c3b3fec766b36c7995a022ce383> released on Tue Feb 13 09:32:00 2018 +0900.


Get information about the WWWJDIC online Japanese dictionaries.


=head2 get_mirrors

    my %mirrors = get_mirrors ();

Get a list of mirrors of WWWJDIC. The keys are arbitrary identifiers,
and the values are the URLs of the mirrors.  As of this version, the
following sites are available:


=item australia


=item canada


=item germany


=item sweden


=item usa



=head1 METHODS

=head2 new

    my $wwwjdic = WWW::WWWJDIC->new (mirror => "japan")

Create the object which extracts the information from WWWJDIC. 

The arguments are a hash with the following keys:


=item mirror

Set the mirror site to use for L</lookup_url>. The possible values can
be obtained from L</get_mirrors>. If you do not specify a mirror, the
current default value is C<usa>.

Please note that mirrors may change or go out of service, and new
mirrors may be created. The above mirrors are obtained using the
script F<boot/scrape-json.pl> in the git repository. This script is
not part of the CPAN distribution.


=head2 lookup_url

    my $url = $wwwjdic->lookup_url ($key);

Make a lookup url (the "backdoor URL") which links to a WWWJDIC
page. As of version 0.005, this URL goes to the combined
dictionary page.

=head1 SEE ALSO


=item WWWJDIC user guide

L<WWWJDIC Japanese Dictionary Server User Guide|http://nihongo.monash.edu/wwwjdicinf.html>




=item L<URI::Escape>

This is used by L</lookup_url> to form the URL.

=item L<JSON::Parse>

This is used to parse the information about WWWJDIC, which is
internally stored in the JSON format.


=head1 BUGS


=item *

Mirrors (including the main edrdg one) frequently go out of service.

=item *

The return value of L</lookup_url> may become invalid as WWWJDIC's
options are often changed so that different letters and numbers are
used to indicate the various dictionaries.

=item *

There is no way to set the dictionary in L</lookup_url>.

=item *

There is no way to get the URL for the plain text output of WWWJDIC.


=head1 HISTORY

I started this module as a scraper for the WWWJDIC web site in around
2009. I released it to CPAN in 2017, but with documentation unwritten
and with scraper code which no longer worked. Currently the only
active use I have for this module is to get the list of mirrors. In
version 0.003 I removed the scraper code, leaving only the method
L</lookup_url> and the function L</get_mirrors>.

Version 0.005 updates the mirror list to remove the Melbourne
University and "gengo.com" mirrors.

=head1 AUTHOR

Ben Bullock, <bkb@cpan.org>


This package and associated files are copyright (C) 
Ben Bullock.

You can use, copy, modify and redistribute this package and associated
files under the Perl Artistic Licence or the GNU General Public