Last active
September 1, 2015 16:56
-
-
Save quininer/750c0bf465e554b8d3c5 to your computer and use it in GitHub Desktop.
观察你都连接到了哪些 Tox node.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
from sys import argv | |
from sh import ss, grep | |
from requests import get | |
def main(_, port=33445, *__): | |
for ip in map((lambda t: t.strip().split()[-1].split(':')[0]), grep(ss(), "33445")): | |
res = get("http://ip.cn/?ip={}".format(ip), headers={ | |
'User-Agent': "curl/7" | |
}).text | |
print(res) | |
if __name__ == "__main__": | |
main(*argv) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment