create account

python 简单实现ip位置查找 by webshell

View this thread on: hive.blogpeakd.comecency.com
· @webshell ·
$0.06
python 简单实现ip位置查找
###  <center>python 简单实现ip位置查找</center>

好久没来steem 了 ,今天刚好需要找一个模糊识别ip地址的小工具 就分享出来

用的github大佬写的工具,和自己收集的ip库

github 地址: https://github.com/ipipdotnet/ipdb-python

源码:

```
import ipdb
db = ipdb.Reader("ip.ipdb")
# print(db.find("2001:250:200::"))
# print(db.find_map("2001:250:200::"))
while(1):
    a = input("请输入ip: ")
    info = db.find_info(a)
    print(info.country_name, info.region_name, info.city_name, info.owner_domain, info.isp_domain, info.latitude,
          info.longitude, info.timezone, info.utc_offset)

```

ip.ipdb 这个自己去下载 运行结果如下:

![微信图片_20181029182612.png](https://cdn.steemitimages.com/DQmSPc7YxQYTAfcAXmGsyuUC6GMyt3XdtarhDMTaYhRpqDM/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20181029182612.png)
👍  , , , , , ,
properties (23)
authorwebshell
permlinkpython-ip
categorypython
json_metadata{"tags":["python","cn","technology","ip","life"],"image":["https://cdn.steemitimages.com/DQmSPc7YxQYTAfcAXmGsyuUC6GMyt3XdtarhDMTaYhRpqDM/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20181029182612.png"],"links":["https://github.com/ipipdotnet/ipdb-python"],"app":"steemit/0.1","format":"markdown"}
created2018-10-29 10:28:48
last_update2018-10-29 10:28:48
depth0
children7
last_payout2018-11-05 10:28:48
cashout_time1969-12-31 23:59:59
total_payout_value0.048 HBD
curator_payout_value0.014 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length712
author_reputation26,383,677,520
root_title"python 简单实现ip位置查找"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,266,649
net_rshares55,351,518,124
author_curate_reward""
vote details (7)
@root0x00 ·
$0.05
这么容易的么 准确不
👍  , , ,
properties (23)
authorroot0x00
permlinkre-webshell-python-ip-20181030t011504280z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2018-10-30 01:15:09
last_update2018-10-30 01:15:09
depth1
children1
last_payout2018-11-06 01:15:09
cashout_time1969-12-31 23:59:59
total_payout_value0.036 HBD
curator_payout_value0.011 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length10
author_reputation75,627,896,971
root_title"python 简单实现ip位置查找"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,310,017
net_rshares43,966,416,097
author_curate_reward""
vote details (4)
@webshell ·
$0.05
还行 到省级 还能精准到哪里呀 你说呢
👍  , ,
properties (23)
authorwebshell
permlinkre-root0x00-re-webshell-python-ip-20181031t132148808z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2018-10-31 13:21:51
last_update2018-10-31 13:21:51
depth2
children0
last_payout2018-11-07 13:21:51
cashout_time1969-12-31 23:59:59
total_payout_value0.036 HBD
curator_payout_value0.011 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length19
author_reputation26,383,677,520
root_title"python 简单实现ip位置查找"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,408,350
net_rshares42,064,135,655
author_curate_reward""
vote details (3)
@steemitboard ·
Congratulations @webshell! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@webshell/voted.png?201810291257</td><td>You received more than 250 upvotes. Your next target is to reach 500 upvotes.</td></tr>
</table>

<sub>_[Click here to view your Board of Honor](https://steemitboard.com/@webshell)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/halloween/@steemitboard/trick-or-treat-publish-your-scariest-halloweeen-story-and-win-a-new-badge"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/RUyB3u.png"></a></td><td><a href="https://steemit.com/halloween/@steemitboard/trick-or-treat-publish-your-scariest-halloweeen-story-and-win-a-new-badge">Trick or Treat - Publish your scariest halloween story and win a new badge</a></td></tr><tr><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-notifications-improved"><img src="https://steemitimages.com/64x128/http://i.cubeupload.com/NgygYH.png"></a></td><td><a href="https://steemit.com/steemitboard/@steemitboard/steemitboard-notifications-improved">SteemitBoard notifications improved</a></td></tr></table>

> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-webshell-20181029t220553000z
categorypython
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-10-29 22:05:51
last_update2018-10-29 22:05:51
depth1
children0
last_payout2018-11-05 22:05:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,604
author_reputation38,975,615,169,260
root_title"python 简单实现ip位置查找"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,302,176
net_rshares0
@steemitboard ·
Congratulations @webshell! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x60/http://steemitboard.com/notifications/firstpayout.png</td><td>You got your First payout</td></tr>
</table>

<sub>_[Click here to view your Board of Honor](https://steemitboard.com/@webshell)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/steemfest/@steemitboard/uk1parhd"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmSz7NTFn1sazJvocuqkN7uZFHxAUTJrVYz7zqYEEExXfY/image.png"></a></td><td><a href="https://steemit.com/steemfest/@steemitboard/uk1parhd">SteemFest³ - SteemitBoard Contest Teaser</a></td></tr><tr><td><a href="https://steemit.com/steemfest/@steemitboard/the-new-steemfest-award-is-ready"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeEYkuDHNp3c9dC6Q5s8Wysi8DrXR89FHAFiu5XoQW8Vr/SteemitBoard_header_Krakow2018.png"></a></td><td><a href="https://steemit.com/steemfest/@steemitboard/the-new-steemfest-award-is-ready">The new Steemfest³ Award is ready!</a></td></tr></table>

> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-webshell-20181106t060026000z
categorypython
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-11-06 06:00:27
last_update2018-11-06 06:00:27
depth1
children0
last_payout2018-11-13 06:00:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,503
author_reputation38,975,615,169,260
root_title"python 简单实现ip位置查找"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,768,035
net_rshares0
@steemitboard ·
Congratulations @webshell! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@webshell/votes.png?201811141046</td><td>You made more than 1250 upvotes. Your next target is to reach 1500 upvotes.</td></tr>
</table>

<sub>_[Click here to view your Board of Honor](https://steemitboard.com/@webshell)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/steemfest/@steemitboard/the-meet-the-steemians-contest-is-over-results-are-coming-soon"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmeLukvNFRsa7RURqsFpiLGEZZD49MiU52JtWmjS5S2wtW/image.png"></a></td><td><a href="https://steemit.com/steemfest/@steemitboard/the-meet-the-steemians-contest-is-over-results-are-coming-soon">The Meet the Steemians Contest is over - Results are coming soon ...</a></td></tr></table>

> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-webshell-20181114t143043000z
categorypython
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-11-14 14:30:42
last_update2018-11-14 14:30:42
depth1
children0
last_payout2018-11-21 14:30:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,292
author_reputation38,975,615,169,260
root_title"python 简单实现ip位置查找"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,277,853
net_rshares0
@ustd ·
$0.05
properties (23)
authorustd
permlinkre-webshell-python-ip-20181031t132757634z
categorypython
json_metadata{"tags":["python"],"app":"steemit/0.1"}
created2018-10-31 13:27:57
last_update2018-10-31 13:27:57
depth1
children0
last_payout2018-11-07 13:27:57
cashout_time1969-12-31 23:59:59
total_payout_value0.036 HBD
curator_payout_value0.011 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6
author_reputation157,962,129,739
root_title"python 简单实现ip位置查找"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,408,716
net_rshares43,172,071,158
author_curate_reward""
vote details (9)
@xinjiang ·
$0.03
厉害了

Posted using [Partiko Android](https://steemit.com/@partiko-android)
👍  ,
properties (23)
authorxinjiang
permlinkxinjiang-re-webshell-python-ip-20181031t132600348z
categorypython
json_metadata{"app":"partiko"}
created2018-10-31 13:26:00
last_update2018-10-31 13:26:00
depth1
children0
last_payout2018-11-07 13:26:00
cashout_time1969-12-31 23:59:59
total_payout_value0.022 HBD
curator_payout_value0.007 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length73
author_reputation32,927,315,550
root_title"python 简单实现ip位置查找"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id74,408,607
net_rshares27,765,852,919
author_curate_reward""
vote details (2)