Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,38 @@

**Find Russian and Ukraine city by IP address and find country for other country. Source http://ipgeobase.ru/**

## Examples

iex> ip = Ipgeobase.find_by_ip("46.188.121.160")
%Ipgeobase{city: "Москва", country: "RU"}
iex> ip.city
"Москва"
iex> ip.country
"RU"

iex> Ipgeobase.find_by_ip("5.10.159.255")
%Ipgeobase{city: "", country: "GB"}
iex> ip.country
"GB"
## Examples

```elixir
iex> ip = Ipgeobase.find_by_ip("46.188.121.160")
%Ipgeobase{city: "Москва", country: "RU"}
iex> ip.city
"Москва"
iex> ip.country
"RU"

iex> Ipgeobase.find_by_ip("5.10.159.255")
%Ipgeobase{city: "", country: "GB"}
iex> ip.country
"GB"
```

## Installation

It [available in Hex](https://hex.pm/packages/ipgeobase/0.0.1), the package can be installed as:

1. Add ipgeobase to your list of dependencies in `mix.exs`:

def deps do
[{:ipgeobase, "~> 0.0.1"}]
end
```elixir
def deps do
[{:ipgeobase, "~> 0.0.1"}]
end
```

2. Ensure ipgeobase is started before your application:

def application do
[applications: [:ipgeobase]]
end

```elixir
def application do
[applications: [:ipgeobase]]
end
```