hello.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html><html><head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  3. <title>Hello,亲: 本WebAPI支持IP城市定位和域名查IP定位</title>
  4. <meta name="keywords" content="开源WebAIP,开源IP定位,IP地址查询,极速批量IP地址查询,IP地址精确查询,IP精准定位,高精度IP定位,国外IP定位">
  5. <link rel="icon" href="/logo/favicon.png" type="image/png">
  6. <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
  7. <style type="text/css">
  8. body { padding-top: 40px; padding-bottom: 40px; background-color: #f5f5f5;
  9. font-family: "PingFang SC", "Helvetica Neue", "Helvetica", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; }
  10. a, input, button { outline: none !important; }
  11. a:focus, a:hover, .btn-link:focus, .btn-link:hover { text-decoration: underline; text-underline-position: under; }
  12. .main { max-width: 950px; padding: 19px 29px 29px; margin: 0 auto 20px; background-color: #fff;
  13. border: 1px solid #e5e5e5; -webkit-border-radius: 5px; -moz-border-radius: 5px;
  14. border-radius: 5px; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
  15. -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
  16. .label-site { font-size: 14px; vertical-align: middle; margin-right: 6px; }
  17. .text { width: 100%; height: 150px; }
  18. .btn-code { padding: 6px 16px; }
  19. </style></head>
  20. <body style="text-align:center;">
  21. <nav class="navbar navbar-inverse navbar-fixed-top">
  22. <div class="container">
  23. <div class="navbar-header">
  24. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  25. <span class="sr-only">Toggle navigation</span>
  26. <span class="icon-bar"></span>
  27. <span class="icon-bar"></span>
  28. <span class="icon-bar"></span>
  29. </button>
  30. <a class="navbar-brand" href="https://262235.xyz/ip/">Python Flask WebAPI</a>
  31. </div>
  32. <div id="navbar" class="collapse navbar-collapse">
  33. <ul class="nav navbar-nav">
  34. <li class="active"><a href="/">首页</a></li>
  35. <li><a href="https://github.com/hongwenjun/ip">github源码</a></li>
  36. <li><a href="https://hub.docker.com/r/hongwenjun/ip">docker镜像</a></li>
  37. <li><a href="https://262235.xyz/index.php/archives/342/">搭建WebAPI参考文章</a></li>
  38. </ul>
  39. </div><!--/.nav-collapse -->
  40. </div>
  41. </nav>
  42. <div class="main">
  43. {% if ip %}
  44. <div class="panel panel-danger">
  45. <div class="panel-heading">
  46. <h3 class="panel-title">Hello, 来自 {{ city }} 的亲:</h3>
  47. </div>
  48. <a href="https://262235.xyz/ip/maps/"> <img style="margin:5px"
  49. src="https://api.map.baidu.com/staticimage/v2?ak=tF8XaCqUG9ZjFR66lqqNXmLzeT24gtGF&mcode=666666&center=110,35&width=500&height=300&zoom=4 "/>
  50. </a>
  51. </div>
  52. <div class="alert-warning">
  53. <h3>{{ ipaddr }}: <a href="https://262235.xyz/maps.php?city={{ city }}" class="label label-info label-site">查看地图 </a></h3>
  54. </div>
  55. {% else %}
  56. <h1>Hello World!</h1>
  57. {% endif %}
  58. <div><span class="label label-success">IP/域名:</span>
  59. <input id="name" type="text">
  60. <input type="button" id="btn" value="提交" class="btn btn-primary btn-sm">
  61. <input type="button" id="json" value="获得json" class="btn btn-primary btn-sm"></div>
  62. <script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  63. <script>
  64. $("#btn").click(function () {
  65. jump_url()
  66. })
  67. function jump_url(params) {
  68. var name = $("#name").val();
  69. const url = window.location.href;
  70. window.location.href = '/ip/' + name
  71. }
  72. $("#json").click(function () {
  73. getjson()
  74. })
  75. function getjson(params) {
  76. var ip = $("#name").val();
  77. const url = 'https://api.map.baidu.com/location/ip?ak=tF8XaCqUG9ZjFR66lqqNXmLzeT24gtGF&ip=';
  78. window.location.href = url + ip + '&coor=bd09ll'
  79. }
  80. </script>
  81. <br>
  82. <form action="/ips/" method="post">
  83. <h3> 批量ip查询地址: <input type="submit" value="点击查询" class="btn btn-primary btn-sm" ></h3>
  84. <textarea type="text" name ="ips" cols=120 rows=8 class="form-control text"
  85. placeholder="输入多行包含ip地址的日志,例:
  86. http://192.168.1.189:5000/ips/
  87. 172.67.158.52 cloudflare.com"></textarea>
  88. </form><br>
  89. <div class="panel panel-info">
  90. <div class="panel-heading">
  91. <h3 class="panel-title">命令行 curl 使用:</h3>
  92. </div>
  93. <strong>curl https://262235.xyz/ip/</strong> # 命令行 URL 要带 / <br>
  94. <strong>curl https://262235.xyz/ip/8.8.8.8</strong> # 查询自定义 IP 定位<br>
  95. <strong>curl https://262235.xyz/ip/github.com</strong> # 按域名查 IP 定位
  96. </div>
  97. <div class="panel panel-success">
  98. <div class="panel-heading">
  99. <h3 class="panel-title">本WebAPI支持IP城市定位和域名查IP定位,同时支持命令行查询</h3>
  100. </div>
  101. github源码:<a href="https://github.com/hongwenjun/ip">https://github.com/hongwenjun/ip</a><p>
  102. docker镜像:<a href="https://hub.docker.com/r/hongwenjun/ip">https://hub.docker.com/r/hongwenjun/ip</a><br>
  103. 搭建WebAPI参考文章:<a href="https://262235.xyz/index.php/archives/342/">Python网络开发简单的IP城市定位WebAPI</a>
  104. </div>
  105. </div></body></html>