This is a Ruby wrapper library around the API provided by Geoplugin (http://www.geoplugin.com).
This is a Ruby wrapper library around the API provided by Geoplugin. Geoplugin is the easiest way for you to know where your visitors are from so that you can provide them with content more relevant to their geographical location.
You can try Geoplugin live at this little demo: https://geopweb.herokuapp.com
Add this line to your application’s Gemfile:
gem 'geoplugin'
And then execute:
$ bundle
Or install it yourself as:
$ gem install geoplugin
require 'geoplugin'
# Find my location without ssl
location = Geoplugin.me
# Find my location with ssl
location = Geoplugin.me(:ssl => true, :key => 'your geoplugin key')
# Find ip location with ssl
location = Geoplugin.new('8.8.8.8')
# Find my location with ssl
location = Geoplugin.new('8.8.8.8', :ssl => true, :key => 'your geoplugin key')
#Like all calls to any of geoPlugin's web services, the default base_currency is USD ($US).
#Thus, if your base currency is NOT $US, then you must add the variable base_currency=XXX to the call like this:
location = Geoplugin.new('151.72.254.22', :base_currency => "EUR")
location = Geoplugin.me(:base_currency => "EUR")
To use the SSL web services, an inexpensive key is required.
request,
status,
city,
region,
areacode,
dmacode,
countrycode,
countryname,
continentcode,
latitude,
longitude,
regioncode,
regionname,
currencycode,
currencysymbol,
currencysymbol_utf,
currencyconverter
Many thanks to Geoplugin for his implementation of the API.
Geoplugin includes GeoLite data created by MaxMind, available from
http://www.maxmind.com.
The restcountry GEM is released under the MIT License.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)