https://github.com/davidesantangelo/geoplugin
This is a Ruby wrapper library around the API provided by Geoplugin (http://www.geoplugin.com).
https://github.com/davidesantangelo/geoplugin
geolocation ruby ruby-wrapper-library rubygem
Last synced: about 1 year ago
JSON representation
This is a Ruby wrapper library around the API provided by Geoplugin (http://www.geoplugin.com).
- Host: GitHub
- URL: https://github.com/davidesantangelo/geoplugin
- Owner: davidesantangelo
- Created: 2015-04-16T08:23:23.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-03-12T16:28:07.000Z (about 7 years ago)
- Last Synced: 2025-04-15T14:51:21.458Z (about 1 year ago)
- Topics: geolocation, ruby, ruby-wrapper-library, rubygem
- Language: Ruby
- Homepage:
- Size: 12.7 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Geoplugin
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.
## See it in action!
You can try Geoplugin live at this little demo: [https://geopweb.herokuapp.com](https://geopweb.herokuapp.com)
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'geoplugin'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install geoplugin
## Usage
```ruby
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.
## Attributes
request,
status,
city,
region,
areacode,
dmacode,
countrycode,
countryname,
continentcode,
latitude,
longitude,
regioncode,
regionname,
currencycode,
currencysymbol,
currencysymbol_utf,
currencyconverter
## Credits
Many thanks to Geoplugin for his implementation of the API.
Geoplugin includes GeoLite data created by MaxMind, available from
http://www.maxmind.com.
## License
The restcountry GEM is released under the MIT License.
## Contributing
1. Fork it ( https://github.com/[my-github-username]/geoplugin/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request