def run(filename): f = file(filename) table = '' for eachLine in f: line = eachLine.strip().decode('utf-8') data = json.loads(line) ws = Website() ws.parse(data) table += ws.to_tr() logging.debug(ws.dict) f.close html = toHTML(table) print(html)
def list(): f = file(filename) table = '' ws = Website() for eachLine in f: line = eachLine.strip().decode('utf-8') data = json.loads(line) ws.parse(data) table += ws.to_tr() f.close html = '<html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"></head>' html += '<table border-spacing="0" border="1">\n<tr>' html += '<tr><th>Target</th><th>Status</th><th>Title</th><th>IP</th><th>Server</th>' html += '<th>Country</th><th>Password</th><th>Cookies</th><th>Email</th><th>Tags</th></tr>' html += table html += "\n</table></html>" return html