-
Notifications
You must be signed in to change notification settings - Fork 0
/
rip.py
37 lines (30 loc) · 792 Bytes
/
rip.py
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
#!/usr/bin/python3
print("content-type: application/json")
print()
print('''<style>
pre{
color: black;
font-weight: bold;
font-size: 20px;
}
</style>
''')
import subprocess as sp
import cgi
fs = cgi.FieldStorage()
plate_number = fs.getvalue("x")
import requests
import xmltodict
import json
def get_vehicle_info(plate_number):
r = requests.get("https://www.regcheck.org.uk/api/reg.asmx/CheckIndia?RegistrationNumber={}&username=xyz".format(plate_number))
data = xmltodict.parse(r.content)
jdata = json.dumps(data)
df = json.loads(jdata)
df1 = json.loads(df['Vehicle']['vehicleJson'])
return df1
output = get_vehicle_info(plate_number)
print("<body>")
print('<h1 style="color:#df405a;" >Output</h1>')
print("<pre>{}</pre>".format(output))
print("</body>")