Package fr.eolya.utils

Examples of fr.eolya.utils.GeoLocalisation


      XMLConfig srcExtra = this.src.getExtra();
      String srcIP = "";
      if (srcExtra!=null) {
        srcIP = srcExtra.getProperty("/geoip/ip", "");
      }
      GeoLocalisation geo;
      try {
        URL hostUrl = new URL(startingUrls.getUrlHome());
        geo = new GeoLocalisation (hostUrl.getHost(), srcIP, null);
      } catch (URISyntaxException e) {
        e.printStackTrace();
        return false;
      } catch (MalformedURLException e) {
        e.printStackTrace();
        return false;
      }
      if (geo.resolve("geoiptool") && geo.hasChanged()) {
        srcExtra.setProperty("/", "geoip", "");
        srcExtra.setProperty("/geoip", "ip", geo.getIp());
        srcExtra.setProperty("/geoip", "latitude", geo.getLatitude());
        srcExtra.setProperty("/geoip", "longitude", geo.getLongitude());
        srcExtra.setProperty("/geoip", "countrycode", geo.getCountryCode());
        srcExtra.setProperty("/geoip", "countryname", geo.getCountryName());
        srcExtra.setProperty("/geoip", "area", geo.getArea());
        srcExtra.setProperty("/geoip", "city", geo.getCity());
        this.src.setExtra(srcExtra);
      }
    }
   
    String scriptPath = config.getProperty("/crawler/param[@name='scripts_path']", "");
View Full Code Here

TOP

Related Classes of fr.eolya.utils.GeoLocalisation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.