App-wdq
view release on metacpan or search on metacpan
sub get_lookup_query {
my $id = shift;
my $entity_id;
if ( $id =~ $ENTITY_PATTERN ) {
$entity_id = $+{id};
$entity_id =~ s/Property://i;
}
else {
# URL could be percent-encoded or not, so normalize
my $uri = URI->new($id);
if ( $uri and $uri->canonical =~ $SITELINK_PATTERN ) {
my ( $base, $title ) = ( $+{base}, $+{title} );
# unescape to UTF-8 octets
$title =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
$title = decode_utf8($title);
if ( $OPT{'no-mediawiki'} ) {
warning("MediaWiki API disabled");
( run in 0.331 second using v1.01-cache-2.11-cpan-709fd43a63f )