Client for wtfismyip.com
use WebService::WTFIsMyIP;
my $wtfismyip = WebService::WTFIsMyIP->new;
say "your IP is", $wtfismyip->json->{IPAddress};This class provides an interface to the wtfismyip service.
my $wtfismyip = WebService::WTFIsMyIP->new(%attributes);Create a new instance of the client. Attributes available:
-
ua
Should be an instance of HTTP::AnyUA, or any class supported by HTTP::AnyUA. HTTP::Tiny is used by default.
-
base_url
The base URL to use.
https://wtfismyip.com/is used by default.
my %hash = $wtfismyip->json->%*;Returns a hash that contains fields such as IPAddress and ISP. The method
is so named after the endpoint that it calls, although the return value is converted
into a Perl hash ref.
Graham Ollis [email protected]
This software is copyright (c) 2025 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.