Exemple #1
0
        static void Main(string[] args)
        {
            string GeoIPAPI   = "http://ip-api.com/json/";
            string WhoIsIPAPI = "http://whois.arin.net/rest/ip/";

            List <string> IPAddresList = FileParser.GetIPAddressList();
            List <IPData> ipDataList   = new List <IPData>();

            foreach (string ipAddress in IPAddresList)
            {
                string whoIsJson = WhoIsLookup.GET(WhoIsIPAPI + ipAddress);
                string geoJson   = IPGeoLookup.GET(GeoIPAPI + ipAddress);

                JObject o = JObject.Parse(whoIsJson);
                string  whoIsCustomerName = (string)o.SelectToken("net.customerRef.@name");
                string  whoIsOrganization = (string)o.SelectToken("net.orgRef.@name");

                IPData geoIPdata = JsonConvert.DeserializeObject <IPData>(geoJson);

                geoIPdata.WhoIsName         = whoIsCustomerName;
                geoIPdata.WhoIsOrganization = whoIsOrganization;

                ipDataList.Add(geoIPdata);
            }

            FileWriter.CreateOutputFile(ipDataList);
        }
Exemple #2
0
 public Dig()
 {
     //_resolver = new Resolver();
     _who = new WhoIsLookup();
     LoadXMLLookups();
     System.Net.ServicePointManager.DefaultConnectionLimit = 100;
     _dnsServers = GetListNameServers();
 }
Exemple #3
0
 private Dig()
 {
     try
     {
         _who = new WhoIsLookup();
         LoadXMLLookups();
         System.Net.ServicePointManager.DefaultConnectionLimit = 200;
         _dnsServers = GetListNameServers();
     }
     catch (Exception e)
     {
         ExceptionExtensions.LogError(e, "CrawlDaddy.API.Dig Constructor");
     }
 }