NAME
WWW::WWWJDIC - information about online Japanese dictionary WWWJDIC
SYNOPSIS
use utf8;
use WWW::WWWJDIC;
my $wj = WWW::WWWJDIC->new (mirror => 'usa');
print $wj->lookup_url ('日本'), "\n";
produces output
http://www.edrdg.org/cgi-bin/wwwjdic/wwwjdic?QMUJ%E6%97%A5%E6%9C%AC_3
(This example is included as synopsis.pl in the distribution.)
VERSION
This documents WWW::WWWJDIC version 0.005 corresponding to git commit d12f085ac5039c3b3fec766b36c7995a022ce383 released on Tue Feb 13 09:32:00 2018 +0900.
DESCRIPTION
Get information about the WWWJDIC online Japanese dictionaries.
FUNCTIONS
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:
- australia
- canada
- germany
- sweden
- usa
METHODS
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:
- mirror
-
Set the mirror site to use for "lookup_url". The possible values can be obtained from "get_mirrors". If you do not specify a mirror, the current default value is
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 boot/scrape-json.pl in the git repository. This script is not part of the CPAN distribution.
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.
SEE ALSO
DEPENDENCIES
- URI::Escape
-
This is used by "lookup_url" to form the URL.
- JSON::Parse
-
This is used to parse the information about WWWJDIC, which is internally stored in the JSON format.
BUGS
Mirrors (including the main edrdg one) frequently go out of service.
The return value of "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.
There is no way to set the dictionary in "lookup_url".
There is no way to get the URL for the plain text output of WWWJDIC.
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 "lookup_url" and the function "get_mirrors".
Version 0.005 updates the mirror list to remove the Melbourne University and "gengo.com" mirrors.
AUTHOR
Ben Bullock, <bkb@cpan.org>
COPYRIGHT & LICENCE
This package and associated files are copyright (C) 2009-2018 Ben Bullock.
You can use, copy, modify and redistribute this package and associated files under the Perl Artistic Licence or the GNU General Public Licence.