holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r11634: LJSUP-11624: Stage 2

Committer: akanashin
LJSUP-11624: Stage 2
U   trunk/cgi-bin/ljcom.pl
Modified: trunk/cgi-bin/ljcom.pl
===================================================================
--- trunk/cgi-bin/ljcom.pl	2012-03-26 13:09:02 UTC (rev 11633)
+++ trunk/cgi-bin/ljcom.pl	2012-03-26 14:05:53 UTC (rev 11634)
@@ -114,6 +114,8 @@
                       );
 use Carp qw (croak);
 
+#$LJ::CACHE_GEOIP_HANDLE ||= 
+
 sub country_of_ip {
     my $ip = shift;
     return undef unless LJ::ModuleCheck->have("Geo::IP::PurePerl");
@@ -121,6 +123,21 @@
     return $gi->country_code_by_addr($ip);
 }
 
+sub org_of_ip {
+    my $ip = shift;
+    return undef unless LJ::ModuleCheck->have("Geo::IP::PurePerl");
+    my $gi = $LJ::CACHE_GEOIP_HANDLE_ORG ||= Geo::IP::PurePerl->open("$LJ::HOME/cgi-bin/GeoIPOrg.dat");
+    return $gi->org_by_addr($ip);
+}
+
+sub isp_of_ip {
+    my $ip = shift;
+    return undef unless LJ::ModuleCheck->have("Geo::IP::PurePerl");
+    my $gi = $LJ::CACHE_GEOIP_HANDLE_ISP ||= Geo::IP::PurePerl->open("$LJ::HOME/cgi-bin/GeoIPISP.dat");
+    return $gi->isp_by_addr($ip);
+}
+
+
 # Name: acct_name_short
 # Input Parm: $caps
 # Returns: short account name type: {new|off|early|paid|on|plus}

Tags: akanashin, holyandrew, ljcom, pl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments