K,
);
our $VERSION = '0.04';
use LWP::UserAgent;
use URI::Escape 'uri_escape_utf8';
use JSON::Parse 'parse_json';
sub make_wiki_url
{
my ($name, $lang) = @_;
if (! $lang) {
# Defaults to En
w/api.php?action=wbgetentities&sites=$lang&titles=$safe_name&props=sitelinks/urls|datatype&format=json";
return $url;
}
sub get_wiki_titles
{
my ($name, %options) = @_;
my $lang = $option
print "$name data was retrieved successfully.\n";
}
my $json = $response->decoded_content ();
my $data = parse_json ($json);
my $array = $data->{entities};
my %lang2title;
for
elium');
Make a URL for the Wikidata page. You will then need to retrieve the
page and parse the JSON yourself. Use a second argument to specify the
language of the page:
use utf8;
use
%B8%AE%E0%B8%B5%E0%B9%80%E0%B8%A5%E0%B8%B5%E0%B8%A2%E0%B8%A1&props=sitelinks/urls|datatype&format=json
(This example is included as L<F<thai-url.pl>|https://fastapi.metacpan.org/source/BKB/WWW-Wikip
ent
L<LWP::UserAgent> is used to retrieve the data from Wikidata.
=item JSON::Parse
L<JSON::Parse> is used to parse the JSON data from Wikidata.
=item URI::Escape
L<URI::Escape> is used to make t