source: trunk/Utilities/MaxMindGeoLite/Script/LazyTest.js @ 49

Last change on this file since 49 was 49, checked in by roman, 12 years ago

singletons, lazy initialization singleton, free threaded marhsaler, x64

File size: 712 bytes
Line 
1function EchoLocation(address, location) {
2  if(location == null) {
3    WScript.Echo(address + ": " + "null");
4    return;
5  }
6  WScript.Echo(address + ": " + location.City + ", " + location.Country + "; " + location.Latitude + ", " + location.Longitude);
7}
8
9locations = new ActiveXObject("AlaxInfo.MaxMindGeoLite.LazyLocations");
10
11elapsedTime = 0;
12for(; ; ) {
13  if(locations.Initialized)
14    break;
15  WScript.Echo("Initializing (" + elapsedTime + " seconds) ...");
16  //EchoLocation("alax.info", locations.Item("alax.info"));
17  WScript.Sleep(5000);
18  elapsedTime += 5;
19}
20
21EchoLocation("alax.info", locations.Item("alax.info"));
22EchoLocation("luxriot.com", locations.Item("luxriot.com"));
23
Note: See TracBrowser for help on using the repository browser.