Skip to content

Commit

Permalink
[docs] add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbreksa-tds committed Nov 30, 2020
1 parent a32e00c commit 2321070
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
eXTReMe IP LOOKUP Client
------------------------

_A simple wrapper for eXTReMe-IP-LOOKUP.com_

# Installation
- Add `https://github.com/abreksa4/extreme-ip-lookup-php.git` to your [composer repositories](https://getcomposer.org/doc/05-repositories.md)
- Run `composer require andrewbreksa/exteme-ip-lookup`

# Usage
```php
use AndrewBreksa\ExtremeIPLookup\Client;
use GuzzleHttp\Client as GuzzleClient;
use Http\Adapter\Guzzle7\Client as GuzzleAdapter;
use Http\Message\MessageFactory\GuzzleMessageFactory;

$client = new Client(
new GuzzleAdapter(new GuzzleClient()),
new GuzzleMessageFactory(),
getenv('EXT_IP_KEY')
);

$ip = '63.70.164.200';

$result = $client->lookup($ip);
echo $result->isp . PHP_EOL;
```

`\AndrewBreksa\ExtremeIPLookup\Client::lookup` returns an instance of [`\AndrewBreksa\ExtremeIPLookup\IPResult`](./src/IPResult.php) on
success, and throws [`\AndrewBreksa\ExtremeIPLookup\ExtremeIPLookupException`](./src/ExtremeIPLookupException.php) on error.

0 comments on commit 2321070

Please sign in to comment.