Skip to content

Commit

Permalink
deploy: 8cf159b
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed May 12, 2023
1 parent d8363ec commit 48fbf7b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 1.6.2">
<meta name="crystal_docs.project_version" content="master">
<meta name="generator" content="Crystal Docs 1.7.3">
<meta name="crystal_docs.project_version" content="0.4.4">
<meta name="crystal_docs.project_name" content="myip">


Expand All @@ -13,7 +13,7 @@
<script type="text/javascript" src="js/doc.js"></script>

<meta name="repository-name" content="myip">
<title>myip master</title>
<title>myip 0.4.4</title>
<script type="text/javascript">
CrystalDocs.base_path = "";
</script>
Expand All @@ -39,7 +39,7 @@ <h1 class="project-name">
</h1>

<span class="project-version">
master
0.4.4
</span>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions Myip.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 1.6.2">
<meta name="crystal_docs.project_version" content="master">
<meta name="generator" content="Crystal Docs 1.7.3">
<meta name="crystal_docs.project_version" content="0.4.4">
<meta name="crystal_docs.project_name" content="myip">


Expand All @@ -13,7 +13,7 @@
<script type="text/javascript" src="js/doc.js"></script>

<meta name="repository-name" content="myip">
<title>Myip - myip master</title>
<title>Myip - myip 0.4.4</title>
<script type="text/javascript">
CrystalDocs.base_path = "";
</script>
Expand All @@ -39,7 +39,7 @@ <h1 class="project-name">
</h1>

<span class="project-version">
master
0.4.4
</span>
</div>
</div>
Expand Down Expand Up @@ -101,7 +101,7 @@ <h2>
</h2>


<a href="https://github.com/crystal-china/myip/blob/a6ffd2c76c59bc3e928f84d1e6330daeee1b7340/src/myip/version.cr#L1" target="_blank">
<a href="https://github.com/crystal-china/myip/blob/v0.4.4/src/myip/version.cr#L1" target="_blank">
myip/version.cr
</a>

Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 1.6.2">
<meta name="crystal_docs.project_version" content="master">
<meta name="generator" content="Crystal Docs 1.7.3">
<meta name="crystal_docs.project_version" content="0.4.4">
<meta name="crystal_docs.project_name" content="myip">


Expand All @@ -13,7 +13,7 @@
<script type="text/javascript" src="js/doc.js"></script>

<meta name="repository-name" content="myip">
<title>myip master</title>
<title>myip 0.4.4</title>
<script type="text/javascript">
CrystalDocs.base_path = "";
</script>
Expand All @@ -39,7 +39,7 @@ <h1 class="project-name">
</h1>

<span class="project-version">
master
0.4.4
</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"repository_name":"myip","body":"# myip\n\n返回本机的公网 IP 以及访问外网的公网 IP,使用 http:/www.ip111.cn 以及 http://www.ip138.com 提供的服务。\n查看[文档](https://crystal-china.github.io/myip/)获取更多帮助\n\n```sh\n ╰─ $ bin/myip \nip111.cn:从国内测试:123.123.123.123 中国 北京市\nip138.com:您的iP地址是:[123.123.123.123 ] 来自:中国北京市西城区 联通\nip111.cn:从国外测试:111.111.111.111 美国 洛杉矶\nip111.cn:从谷歌测试:111.111.111.111 美国 洛杉矶\n```\n\n## Contributing\n\n1. Fork it (<https://github.com/crystal-china/myip/fork>)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Billy.Zheng](https://github.com/zw963) - creator and maintainer\n","program":{"html_id":"myip/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"myip","program":true,"enum":false,"alias":false,"const":false,"class_methods":[{"html_id":"from_url(url:String,follow:Bool=false):Lexbor::Parser-class-method","name":"from_url","abstract":false,"args":[{"name":"url","external_name":"url","restriction":"String"},{"name":"follow","default_value":"false","external_name":"follow","restriction":"Bool"}],"args_string":"(url : String, follow : Bool = false) : Lexbor::Parser","args_html":"(url : String, follow : Bool = <span class=\"n\">false</span>) : Lexbor::Parser","location":{"filename":"src/myip.cr","line_number":9,"url":"https://github.com/crystal-china/myip/blob/a6ffd2c76c59bc3e928f84d1e6330daeee1b7340/src/myip.cr#L9"},"def":{"name":"from_url","args":[{"name":"url","external_name":"url","restriction":"String"},{"name":"follow","default_value":"false","external_name":"follow","restriction":"Bool"}],"return_type":"Lexbor::Parser","visibility":"Public","body":"begin\n response = HTTP::Client.get(url)\n if response.status_code == 200\n Lexbor::Parser.new(response.body)\n else\n if follow && (response.status_code == 301)\n from_url(response.headers[\"Location\"], follow: true)\n else\n raise(ArgumentError.new(\"Host returned #{response.status_code}\"))\n end\n end\nrescue Socket::Error\n raise(Socket::Error.new(\"Host #{url} cannot be fetched\"))\nend"}},{"html_id":"get_ip_from_ib_sb(chan)-class-method","name":"get_ip_from_ib_sb","abstract":false,"args":[{"name":"chan","external_name":"chan","restriction":""}],"args_string":"(chan)","args_html":"(chan)","location":{"filename":"src/myip.cr","line_number":22,"url":"https://github.com/crystal-china/myip/blob/a6ffd2c76c59bc3e928f84d1e6330daeee1b7340/src/myip.cr#L22"},"def":{"name":"get_ip_from_ib_sb","args":[{"name":"chan","external_name":"chan","restriction":""}],"visibility":"Public","body":"spawn do\n begin\n url = \"https://api.ip.sb/geoip\"\n response = HTTP::Client.get(url)\n result = JSON.parse(response.body)\n io = IO::Memory.new\n PrettyPrint.format(result, io, 79)\n io.rewind\n chan.send({\"ip.sb/geoip:\", io.gets_to_end})\n rescue Socket::Error\n STDERR.puts(\"visit #{url} failed, please check internet connection.\")\n rescue ArgumentError\n STDERR.puts(\"#{url} return 500\")\n rescue ex\n STDERR.puts(ex.message)\n end\nend"}},{"html_id":"get_ip_from_ip111(chan)-class-method","name":"get_ip_from_ip111","abstract":false,"args":[{"name":"chan","external_name":"chan","restriction":""}],"args_string":"(chan)","args_html":"(chan)","location":{"filename":"src/myip.cr","line_number":58,"url":"https://github.com/crystal-china/myip/blob/a6ffd2c76c59bc3e928f84d1e6330daeee1b7340/src/myip.cr#L58"},"def":{"name":"get_ip_from_ip111","args":[{"name":"chan","external_name":"chan","restriction":""}],"visibility":"Public","body":"begin\n ip111_url = \"http://www.ip111.cn\"\n doc = from_url(ip111_url, follow: true)\n iframe = (doc.nodes(\"iframe\")).map do |node|\n spawn do\n begin\n url = (node.attribute_by(\"src\")).not_nil!\n ip = (from_url(url)).body!.tag_text.strip\n title = (node.parent!.parent!.parent!.css(\".card-header\")).first.tag_text.strip\n chan.send({\"ip111.cn:#{title}:\", ip})\n rescue Socket::Error\n STDERR.puts(\"visit #{url} failed, please check internet connection.\")\n rescue ArgumentError\n STDERR.puts(\"#{url} return 500\")\n rescue ex\n STDERR.puts(ex.message)\n end\n end\n end\n {doc, iframe.size}\nrescue Socket::Error\n STDERR.puts(\"visit #{ip111_url} failed, please check internet connection.\")\n exit\nrescue ArgumentError\n STDERR.puts(\"#{ip111_url} return 500\")\n exit\nrescue ex\n STDERR.puts(ex.message)\n exit\nend"}},{"html_id":"get_ip_from_ip138(chan)-class-method","name":"get_ip_from_ip138","abstract":false,"args":[{"name":"chan","external_name":"chan","restriction":""}],"args_string":"(chan)","args_html":"(chan)","location":{"filename":"src/myip.cr","line_number":40,"url":"https://github.com/crystal-china/myip/blob/a6ffd2c76c59bc3e928f84d1e6330daeee1b7340/src/myip.cr#L40"},"def":{"name":"get_ip_from_ip138","args":[{"name":"chan","external_name":"chan","restriction":""}],"visibility":"Public","body":"spawn do\n begin\n url = \"http://www.ip138.com\"\n doc = from_url(url, follow: true)\n ip138_url = (doc.css(\"iframe\")).first.attribute_by(\"src\")\n url = \"http:#{ip138_url}\"\n doc = from_url(url)\n chan.send({\"ip138.com:\", (doc.css(\"body p\")).first.tag_text.strip})\n rescue Socket::Error\n STDERR.puts(\"visit #{url} failed, please check internet connection.\")\n rescue ArgumentError\n STDERR.puts(\"#{url} return 500\")\n rescue ex\n STDERR.puts(ex.message)\n end\nend"}}],"types":[{"html_id":"myip/Myip","path":"Myip.html","kind":"module","full_name":"Myip","name":"Myip","abstract":false,"locations":[{"filename":"src/myip/version.cr","line_number":1,"url":"https://github.com/crystal-china/myip/blob/a6ffd2c76c59bc3e928f84d1e6330daeee1b7340/src/myip/version.cr#L1"}],"repository_name":"myip","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version \\\"/home/runner/work/myip/myip/src/myip\\\"`).chomp.stringify }}"}]}]}}
{"repository_name":"myip","body":"# myip\n\n返回本机的公网 IP 以及访问外网的公网 IP,使用 http:/www.ip111.cn 以及 http://www.ip138.com 提供的服务。\n查看[文档](https://crystal-china.github.io/myip/)获取更多帮助\n\n```sh\n ╰─ $ bin/myip \nip111.cn:从国内测试:123.123.123.123 中国 北京市\nip138.com:您的iP地址是:[123.123.123.123 ] 来自:中国北京市西城区 联通\nip111.cn:从国外测试:111.111.111.111 美国 洛杉矶\nip111.cn:从谷歌测试:111.111.111.111 美国 洛杉矶\n```\n\n## Contributing\n\n1. Fork it (<https://github.com/crystal-china/myip/fork>)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Billy.Zheng](https://github.com/zw963) - creator and maintainer\n","program":{"html_id":"myip/toplevel","path":"toplevel.html","kind":"module","full_name":"Top Level Namespace","name":"Top Level Namespace","abstract":false,"locations":[],"repository_name":"myip","program":true,"enum":false,"alias":false,"const":false,"class_methods":[{"html_id":"from_url(url:String,follow:Bool=false):Lexbor::Parser-class-method","name":"from_url","abstract":false,"args":[{"name":"url","external_name":"url","restriction":"String"},{"name":"follow","default_value":"false","external_name":"follow","restriction":"Bool"}],"args_string":"(url : String, follow : Bool = false) : Lexbor::Parser","args_html":"(url : String, follow : Bool = <span class=\"n\">false</span>) : Lexbor::Parser","location":{"filename":"src/myip.cr","line_number":9,"url":"https://github.com/crystal-china/myip/blob/v0.4.4/src/myip.cr#L9"},"def":{"name":"from_url","args":[{"name":"url","external_name":"url","restriction":"String"},{"name":"follow","default_value":"false","external_name":"follow","restriction":"Bool"}],"return_type":"Lexbor::Parser","visibility":"Public","body":"begin\n response = HTTP::Client.get(url)\n if response.status_code == 200\n Lexbor::Parser.new(response.body)\n else\n if follow && (response.status_code == 301)\n from_url(response.headers[\"Location\"], follow: true)\n else\n raise(ArgumentError.new(\"Host returned #{response.status_code}\"))\n end\n end\nrescue Socket::Error\n raise(Socket::Error.new(\"Host #{url} cannot be fetched\"))\nend"}},{"html_id":"get_ip_from_ib_sb(chan)-class-method","name":"get_ip_from_ib_sb","abstract":false,"args":[{"name":"chan","external_name":"chan","restriction":""}],"args_string":"(chan)","args_html":"(chan)","location":{"filename":"src/myip.cr","line_number":22,"url":"https://github.com/crystal-china/myip/blob/v0.4.4/src/myip.cr#L22"},"def":{"name":"get_ip_from_ib_sb","args":[{"name":"chan","external_name":"chan","restriction":""}],"visibility":"Public","body":"spawn do\n begin\n url = \"https://api.ip.sb/geoip\"\n response = HTTP::Client.get(url)\n result = JSON.parse(response.body)\n io = IO::Memory.new\n PrettyPrint.format(result, io, 79)\n io.rewind\n chan.send({\"ip.sb/geoip:\", io.gets_to_end})\n rescue Socket::Error\n STDERR.puts(\"visit #{url} failed, please check internet connection.\")\n rescue ArgumentError\n STDERR.puts(\"#{url} return 500\")\n rescue ex\n STDERR.puts(ex.message)\n end\nend"}},{"html_id":"get_ip_from_ip111(chan)-class-method","name":"get_ip_from_ip111","abstract":false,"args":[{"name":"chan","external_name":"chan","restriction":""}],"args_string":"(chan)","args_html":"(chan)","location":{"filename":"src/myip.cr","line_number":58,"url":"https://github.com/crystal-china/myip/blob/v0.4.4/src/myip.cr#L58"},"def":{"name":"get_ip_from_ip111","args":[{"name":"chan","external_name":"chan","restriction":""}],"visibility":"Public","body":"begin\n ip111_url = \"http://www.ip111.cn\"\n doc = from_url(ip111_url, follow: true)\n iframe = (doc.nodes(\"iframe\")).map do |node|\n spawn do\n begin\n url = (node.attribute_by(\"src\")).not_nil!\n ip = (from_url(url)).body!.tag_text.strip\n title = (node.parent!.parent!.parent!.css(\".card-header\")).first.tag_text.strip\n chan.send({\"ip111.cn:#{title}:\", ip})\n rescue Socket::Error\n STDERR.puts(\"visit #{url} failed, please check internet connection.\")\n rescue ArgumentError\n STDERR.puts(\"#{url} return 500\")\n rescue ex\n STDERR.puts(ex.message)\n end\n end\n end\n {doc, iframe.size}\nrescue Socket::Error\n STDERR.puts(\"visit #{ip111_url} failed, please check internet connection.\")\n exit\nrescue ArgumentError\n STDERR.puts(\"#{ip111_url} return 500\")\n exit\nrescue ex\n STDERR.puts(ex.message)\n exit\nend"}},{"html_id":"get_ip_from_ip138(chan)-class-method","name":"get_ip_from_ip138","abstract":false,"args":[{"name":"chan","external_name":"chan","restriction":""}],"args_string":"(chan)","args_html":"(chan)","location":{"filename":"src/myip.cr","line_number":40,"url":"https://github.com/crystal-china/myip/blob/v0.4.4/src/myip.cr#L40"},"def":{"name":"get_ip_from_ip138","args":[{"name":"chan","external_name":"chan","restriction":""}],"visibility":"Public","body":"spawn do\n begin\n url = \"http://www.ip138.com\"\n doc = from_url(url, follow: true)\n ip138_url = (doc.css(\"iframe\")).first.attribute_by(\"src\")\n url = \"http:#{ip138_url}\"\n doc = from_url(url)\n chan.send({\"ip138.com:\", (doc.css(\"body p\")).first.tag_text.strip})\n rescue Socket::Error\n STDERR.puts(\"visit #{url} failed, please check internet connection.\")\n rescue ArgumentError\n STDERR.puts(\"#{url} return 500\")\n rescue ex\n STDERR.puts(ex.message)\n end\nend"}}],"types":[{"html_id":"myip/Myip","path":"Myip.html","kind":"module","full_name":"Myip","name":"Myip","abstract":false,"locations":[{"filename":"src/myip/version.cr","line_number":1,"url":"https://github.com/crystal-china/myip/blob/v0.4.4/src/myip/version.cr#L1"}],"repository_name":"myip","program":false,"enum":false,"alias":false,"const":false,"constants":[{"id":"VERSION","name":"VERSION","value":"{{ (`shards version \\\"/home/runner/work/myip/myip/src/myip\\\"`).chomp.stringify }}"}]}]}}
Loading

0 comments on commit 48fbf7b

Please sign in to comment.