-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp.py
More file actions
21 lines (21 loc) · 738 Bytes
/
http.py
File metadata and controls
21 lines (21 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/python
#Written by krn_bhargav(kapslock)
from libmicrocontest2_python27 import * # External library given by website should be in same directory.
import subprocess,bs4
def main():
c = commence_contest(15,'kapslock','') # password in left blank
x = c.get_int('x')
print("[Get] "+str(x))
url = "http://www.microcontest.com/contests/15/nombre.php"
r = subprocess.check_call(['curl',url+'?x='+str(x),'-o','url.txt'])
with open('url.txt','r') as f:
web = bs4.BeautifulSoup(f,'lxml')
d = web.p.text
print('[Found] '+str(d))
c.append_answer('y',d)
print(c.submit_answer())
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print()