GithubHelp home page GithubHelp logo

hjy618 / ip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hongwenjun/ip

0.0 0.0 0.0 33 KB

本WebAPI支持IP城市定位和域名查IP定位,同时支持命令行查询

Home Page: https://262235.xyz/ip/

HTML 32.30% Python 42.60% Dockerfile 10.40% PHP 14.70%

ip's Introduction

ip: Python WebAPI

本WebAPI支持IP城市定位和域名查IP定位,同时支持命令行查询

安装部署简易命令

git clone https://github.com/hongwenjun/ip.git
pip3  install Flask  ipip-ipdb
cd ip
wget https://cdn.jsdelivr.net/npm/qqwry.ipdb/qqwry.ipdb
flask run --host=0.0.0.0

Docker容器傻瓜部署

  • 如果要挂载 /app 目录,宿主机先准备好文件
docker run -d -p 80:5000 --restart=always --name ip hongwenjun/ip

搭建WebAPI参考文章

Python网络开发简单的IP城市定位WebAPI

Pytyhon 使用百度地图API 进行 IP普通定位和地图显示

演示网址: https://www.262235.xyz/ip/maps/

GPS定位百度的太拉,推荐购买: 免费试用500次, 1元能使用1万次 IP定位 API 接口

def ip2gdgps(ip):
    url = 'http://ips.market.alicloudapi.com/iplocaltion?ip=' + ip
    headers = {"Authorization":"APPCODE  <<<IP定位APPCODE>>>" ,"Content-Type":"application/json; charset=utf-8" }
    try:
        r = requests.get(url=url , headers=headers)
        data = r.json()
    except :
        return
    # print(data)
    if data['code'] != 100:
        return  (116.39564504, 39.92998578 , data['code'])    # 查不到返回 北京 x,y
    elif data['message'] == "success":
        x = data['result']['lng']
        y = data['result']['lat']
        return  (x, y, data['code'], data)

ip's People

Contributors

hongwenjun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.