-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhoisToWiki.py
More file actions
executable file
·49 lines (35 loc) · 889 Bytes
/
whoisToWiki.py
File metadata and controls
executable file
·49 lines (35 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# For Atari-Frosh to Get Whois into Wiki
# make it executable and execute with ip address like '192.168.1.10'
# IMPORTS
import os
import sys
IP = sys.argv[1]
command = 'whois ' + IP
f = os.popen(command)
text = []
text.append("{|")
for line in f:
if line[:1] == "%":
newline = "| ||"
data = line.split()
data.pop(0)
for element in data:
newline += " " + element
newline += "\n|-"
text.append(newline)
elif len(line) < 2:
pass
else:
newline = "|"
data = line.split()
if len(data) >0:
newline += data.pop(0) + "||"
for element in data:
newline += " " + element
newline += "\n|-"
text.append(newline)
text.append("|}")
for line in text:
print line