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 #1

Open
jelu opened this issue Jun 7, 2016 · 0 comments
Open

Use Geo::IP as fallback #1

jelu opened this issue Jun 7, 2016 · 0 comments

Comments

@jelu
Copy link
Member

jelu commented Jun 7, 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 jelu added this to the v2.0.0 milestone Jun 7, 2016
@jelu jelu modified the milestones: v2.01, v2.00 Jun 8, 2016
@jelu jelu removed this from the v2.01 milestone May 24, 2017
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