JQuery whitelist update, reported in #24

This commit is contained in:
Gabor Gyorvari
2018-09-15 08:02:16 +02:00
parent b6c3904d54
commit 7d8854ae8e
2 changed files with 218 additions and 0 deletions

22
tools/jquery.py Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
import urllib2
import re
import hashlib
def fetch(url):
response = urllib2.urlopen(url)
return response.read()
def main():
html = fetch('https://code.jquery.com/jquery/')
regex = re.compile(r"<a class='open\-sri\-modal' href='(/jquery-.*?\.js)'")
m1 = regex.search(html)
for m in regex.findall(html):
js = fetch("https://code.jquery.com" + m)
hash = hashlib.md5()
hash.update(js)
print hash.hexdigest() + " " + m
if __name__ == '__main__':
main()