Skip to content

Commit

Permalink
Merge pull request #11 from secynic/dev
Browse files Browse the repository at this point in the history
0.1.8
  • Loading branch information
secynic committed Sep 17, 2013
2 parents 8f9c506 + eb4b77a commit dad0c04
Show file tree
Hide file tree
Showing 6 changed files with 1,198 additions and 1,155 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

0.1.8 (2013-09-17)
------------------

- Removed set_proxy() in favor of having the user provide their own urllib.request.OpenerDirector instance as a parameter to IPWhois().
- Restructured package in favor of modularity. get_countries() is now located in ipwhois.utils.
- Added exception WhoisLookupError for IPWhois.lookup() and IPWhois.lookup_rws().

0.1.7 (2013-09-16)
------------------

Expand Down
28 changes: 16 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Usage Examples

Typical usage::

>>>> import ipwhois
>>>> from ipwhois import IPWhois
>>>> from pprint import pprint
>>>> obj = ipwhois.IPWhois('74.125.225.229')
>>>> obj = IPWhois('74.125.225.229')
>>>> results = obj.lookup()
>>>> pprint(results)
Expand All @@ -38,10 +38,10 @@ Typical usage::
REST (HTTP)::

>>>> import ipwhois
>>>> from ipwhois import IPWhois
>>>> from pprint import pprint
>>>> obj = ipwhois.IPWhois('74.125.225.229')
>>>> obj = IPWhois('74.125.225.229')
>>>> results = obj.lookup_rws()
>>>> pprint(results)
Expand All @@ -63,28 +63,32 @@ REST (HTTP)::
'raw': None
}

Proxy (Optional before ipwhois.IPWhois.lookup_rws())::
Proxy::

>>>> import ipwhois
>>>> ipwhois.set_proxy('192.168.0.1', '80', 'some_username', 'some_password')
>>>> from urllib import request
>>>> from ipwhois import IPWhois
>>>> handler = request.ProxyHandler({'http': 'http://192.168.0.1:80/'})
>>>> opener = request.build_opener(handler)
>>>> obj = IPWhois('74.125.225.229', proxy_opener = opener)

Hostname::

>>>> import ipwhois
>>>> from ipwhois import IPWhois
>>>> from pprint import pprint
>>>> obj = ipwhois.IPWhois('74.125.225.229')
>>>> obj = IPWhois('74.125.225.229')
>>>> results = obj.get_host()
>>>> pprint(results)
('dfw06s26-in-f5.1e100.net', [], ['74.125.225.229'])
Countries::

>>>> import ipwhois
>>>> from ipwhois import IPWhois
>>>> from ipwhois.utils import get_countries
>>>> countries = ipwhois.get_countries()
>>>> obj = ipwhois.IPWhois('74.125.225.229')
>>>> countries = get_countries()
>>>> obj = IPWhois('74.125.225.229')
>>>> results = obj.lookup(False)
>>>> print(countries[results['nets'][0]['country']])

Expand Down
Loading

0 comments on commit dad0c04

Please sign in to comment.