Advertisement
Leka74

Finder Plugin

Feb 19th, 2011
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.88 KB | None | 0 0
  1. --[[--------------------------------------------------------------------------------------------------------------------------------------------
  2. Name: Finder
  3. Type: Action Plugin
  4. By: Leka74 - uvlabs
  5. URL: http://uvlabs.co.cc
  6. Note: The plugin has been created by using the GeoPlugin API therefore the internet is required so the plugin can work.
  7. Example:
  8.     Finder.GetInformation("xxx.xx.xx.xx");
  9.     local strCountry = Finder.GetCountry();
  10.     if strCountry then
  11.         Dialog.Message("Your Country is", strCountry);
  12.     end
  13.     Finder.ClearCache();
  14.    
  15. ----------------------------------------------------------------------------------------------------------------------------------------------]]
  16.  
  17. Finder = {};
  18.  
  19. function Finder.GetInformation(strIP)
  20.     HTTP.Download("http://www.geoplugin.net/xml.gp?ip="..strIP, _TempFolder.."\\location.xml", MODE_BINARY, 20, 80, nil, nil, nil);
  21.     XML.Load(_TempFolder.."\\location.xml");
  22. end
  23.  
  24. function Finder.GetCountry()
  25.     return XML.GetValue("geoPlugin/geoplugin_countryName");
  26. end
  27.  
  28. function Finder.GetCity()
  29.     return XML.GetValue("geoPlugin/geoplugin_city");
  30. end
  31.  
  32. function Finder.GetLatitude()
  33.     return XML.GetValue("geoPlugin/geoplugin_latitude");
  34. end
  35.  
  36. function Finder.GetLongitude()
  37.     return XML.GetValue("geoPlugin/geoplugin_longitude");
  38. end
  39.  
  40. function Finder.GetContinentCode()
  41.     return XML.GetValue("geoPlugin/geoplugin_continentCode");
  42. end
  43.  
  44. function Finder.GetRegion()
  45.     return XML.GetValue("geoPlugin/geoplugin_region");
  46. end
  47.  
  48. function Finder.GetRegionCode()
  49.     return XML.GetValue("geoPlugin/geoplugin_regionCode");
  50. end
  51.  
  52. function Finder.GetCountryCode()
  53.     return XML.GetValue("geoPlugin/geoplugin_countryCode");
  54. end
  55.  
  56. function Finder.GetCurrencyCode()
  57.     return XML.GetValue("geoPlugin/geoplugin_currencyCode");
  58. end
  59.  
  60. function Finder.ClearCache()
  61.     File.Delete(_TempFolder.."\\location.xml", false, false, false, nil);
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement