mirror of
https://github.com/ericchiang/pup
synced 2024-11-24 00:48:36 +00:00
15 lines
396 B
Python
15 lines
396 B
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
from __future__ import print_function
|
||
|
from hashlib import sha1
|
||
|
from subprocess import Popen, PIPE, STDOUT
|
||
|
|
||
|
data = open("index.html", "r").read()
|
||
|
|
||
|
for line in open("cmds.txt", "r"):
|
||
|
line = line.strip()
|
||
|
p = Popen(['pup', line], stdout=PIPE, stdin=PIPE, stderr=PIPE)
|
||
|
h = sha1()
|
||
|
h.update(p.communicate(input=data)[0])
|
||
|
print("%s %s" % (h.hexdigest(), line))
|