Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[--------------------------------------------------------------------------------------------------------------------------------------------
- Name: Finder
- Type: Action Plugin
- By: Leka74 - uvlabs
- URL: http://uvlabs.co.cc
- Email: leke.dobruna@gmail.com
- Note: The plugin has been created by using the GeoPlugin API therefore the internet is required so the plugin can work.
- Example:
- Finder.GetInformation("xxx.xx.xx.xx");
- local strCountry = Finder.GetCountry();
- if strCountry then
- Dialog.Message("Your Country is", strCountry);
- end
- Finder.ClearCache();
- ----------------------------------------------------------------------------------------------------------------------------------------------]]
- Finder = {};
- function Finder.GetInformation(strIP)
- HTTP.Download("http://www.geoplugin.net/xml.gp?ip="..strIP, _TempFolder.."\\location.xml", MODE_BINARY, 20, 80, nil, nil, nil);
- XML.Load(_TempFolder.."\\location.xml");
- end
- function Finder.GetCountry()
- return XML.GetValue("geoPlugin/geoplugin_countryName");
- end
- function Finder.GetCity()
- return XML.GetValue("geoPlugin/geoplugin_city");
- end
- function Finder.GetLatitude()
- return XML.GetValue("geoPlugin/geoplugin_latitude");
- end
- function Finder.GetLongitude()
- return XML.GetValue("geoPlugin/geoplugin_longitude");
- end
- function Finder.GetContinentCode()
- return XML.GetValue("geoPlugin/geoplugin_continentCode");
- end
- function Finder.GetRegion()
- return XML.GetValue("geoPlugin/geoplugin_region");
- end
- function Finder.GetRegionCode()
- return XML.GetValue("geoPlugin/geoplugin_regionCode");
- end
- function Finder.GetCountryCode()
- return XML.GetValue("geoPlugin/geoplugin_countryCode");
- end
- function Finder.GetCurrencyCode()
- return XML.GetValue("geoPlugin/geoplugin_currencyCode");
- end
- function Finder.ClearCache()
- File.Delete(_TempFolder.."\\location.xml", false, false, false, nil);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement