Skip to content

uperl/WebService-WTFIsMyIP

Repository files navigation

WebService::WTFIsMyIP static linux

Client for wtfismyip.com

SYNOPSIS

use WebService::WTFIsMyIP;

my $wtfismyip = WebService::WTFIsMyIP->new;
say "your IP is", $wtfismyip->json->{IPAddress};

DESCRIPTION

This class provides an interface to the wtfismyip service.

CONSTRUCTOR

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.

METHODS

json

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.

AUTHOR

Graham Ollis [email protected]

COPYRIGHT AND LICENSE

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.

About

Client for wtfismyip.com

Resources

Stars

Watchers

Forks

Packages

No packages published