Advertisement
Leka74

Finder Plugin

Feb 19th, 2011
362
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. Email: leke.dobruna@gmail.com
  7. Note: The plugin has been created by using the GeoPlugin API therefore the internet is required so the plugin can work.
  8. Example:
  9.     Finder.GetInformation("xxx.xx.xx.xx");
  10.     local strCountry = Finder.GetCountry();
  11.     if strCountry then
  12.         Dialog.Message("Your Country is", strCountry);
  13.     end
  14.     Finder.ClearCache();
  15.    
  16. ----------------------------------------------------------------------------------------------------------------------------------------------]]
  17.  
  18. Finder = {};
  19.  
  20. function Finder.GetInformation(strIP)
  21.     HTTP.Download("http://www.geoplugin.net/xml.gp?ip="..strIP, _TempFolder.."\\location.xml", MODE_BINARY, 20, 80, nil, nil, nil);
  22.     XML.Load(_TempFolder.."\\location.xml");
  23. end
  24.  
  25. function Finder.GetCountry()
  26.     return XML.GetValue("geoPlugin/geoplugin_countryName");
  27. end
  28.  
  29. function Finder.GetCity()
  30.     return XML.GetValue("geoPlugin/geoplugin_city");
  31. end
  32.  
  33. function Finder.GetLatitude()
  34.     return XML.GetValue("geoPlugin/geoplugin_latitude");
  35. end
  36.  
  37. function Finder.GetLongitude()
  38.     return XML.GetValue("geoPlugin/geoplugin_longitude");
  39. end
  40.  
  41. function Finder.GetContinentCode()
  42.     return XML.GetValue("geoPlugin/geoplugin_continentCode");
  43. end
  44.  
  45. function Finder.GetRegion()
  46.     return XML.GetValue("geoPlugin/geoplugin_region");
  47. end
  48.  
  49. function Finder.GetRegionCode()
  50.     return XML.GetValue("geoPlugin/geoplugin_regionCode");
  51. end
  52.  
  53. function Finder.GetCountryCode()
  54.     return XML.GetValue("geoPlugin/geoplugin_countryCode");
  55. end
  56.  
  57. function Finder.GetCurrencyCode()
  58.     return XML.GetValue("geoPlugin/geoplugin_currencyCode");
  59. end
  60.  
  61. function Finder.ClearCache()
  62.     File.Delete(_TempFolder.."\\location.xml", false, false, false, nil);
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement