Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document IP lookup feature / Fix iplookup None bug #160

Merged
merged 4 commits into from
Oct 3, 2018
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,15 @@ $ yoda ideas remove --task <task_name> --inside <project_name>
$ yoda ideas remove --project <project_name>
```

#### IP lookup

Get the geographical location of an IP address.

```
$ yoda iplookup 23.20.227.213
$ Virginia, United States
```

#### learn

This command group contains commands that, helpful in learning new things, will be. Yeesssssss.
Expand Down Expand Up @@ -282,6 +291,7 @@ To create an issue in the github repository simple thing that shows a link. Yee
- [urllib3](https://github.com/urllib3/urllib3): HTTP client
- [Certifi](https://github.com/certifi/python-certifi): Python SSL Certificates
- [idna](https://github.com/kjd/idna): For the domain name
- [GeoIP2-database](https://www.maxmind.com/en/geoip2-city): For geographical IP lookups
- [future](https://pypi.org/project/future/): the layer of compatability for Python 2/3
- [Google URL Shortener](https://developers.google.com/url-shortener/): URL shortener
- [News API](https://newsapi.org/): Used to get the top headlines from Hacker News
Expand Down
7 changes: 7 additions & 0 deletions modules/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,14 @@ def taskMaster():
@click.pass_context
@click.argument('ip_address', nargs=1, required=False, callback=alias_checker)
def iplookup(ctx, ip_address):
"""
Find the geographical location of a given IP address.
"""
# import pdb; pdb.set_trace()
ip_address = get_arguments(ctx, 1)
if not ip_address:
return click.echo('Please supply an IP address as follows: $ yoda iplookup <ip_address>')

_ip_address = str(ip_address)

import geoip2.database
Expand Down