Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Use Geo::IP as fallback #2

Closed
jelu opened this issue Apr 14, 2016 · 1 comment
Closed

Use Geo::IP as fallback #2

jelu opened this issue Apr 14, 2016 · 1 comment

Comments

@jelu
Copy link
Member

jelu commented Apr 14, 2016

Based on the Debian package patches Geo::IP could be used as a fallback if IP::Country does not exist.

--- a/presenter/perllib/DSC/grapher/plot.pm
+++ b/presenter/perllib/DSC/grapher/plot.pm
@@ -249,14 +249,12 @@
     names  => [ qw(Unknown IANA LACNIC APNIC RIPE ARIN) ],
     colors => [ qw(black red purple yellow blue brightgreen) ],
     label_func => sub {
-   use IP::Country;
-   my $l = new IP::Country::Fast;
-   $l->inet_atocc(shift) || '??';
+   use Geo::IP;
+   my $l = Geo::IP->new(GEOIP_MEMORY_CACHE|GEOIP_CHECK_CACHE);
+   $l->country_code_by_addr(shift) || '??';
     },
     color_func => sub {
-   use IP::Authority;
-   my $l = new IP::Authority;
-   $l->inet_atoauth(shift) || '??';
+   "??";
     },
     data_reader => \&DSC::extractor::read_data2,
     data_summer => \&DSC::grapher::data_summer_0d,
@jelu
Copy link
Member Author

jelu commented Jun 7, 2016

Moved to DNS-OARC/p5-DSC#1

@jelu jelu closed this as completed Jun 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant