|
@@ -7,18 +7,14 @@ from urllib import parse
|
|
|
import time
|
|
import time
|
|
|
import threading
|
|
import threading
|
|
|
|
|
|
|
|
-def send_p(d):
|
|
|
|
|
- d = html.escape(d)
|
|
|
|
|
|
|
+def send_parser(data):
|
|
|
|
|
+ data = html.escape(data)
|
|
|
|
|
|
|
|
- js_p = re.compile('javascript:', re.I)
|
|
|
|
|
- d = js_p.sub('', d)
|
|
|
|
|
|
|
+ javascript = re.compile('javascript:', re.I)
|
|
|
|
|
+ data = javascript.sub('', data)
|
|
|
|
|
|
|
|
- d = re.sub('<a href="(?:[^"]*)">(?P<in>(?:(?!<).)*)<\/a>', '<a href="' + url_pas('\g<in>') + '">\g<in></a>', d)
|
|
|
|
|
-
|
|
|
|
|
- return d
|
|
|
|
|
-
|
|
|
|
|
-def url_pas(data):
|
|
|
|
|
- return parse.quote(data).replace('/','%2F')
|
|
|
|
|
|
|
+ data = re.sub('<a href="(?:[^"]*)">(?P<in>(?:(?!<).)*)<\/a>', '<a href="' + parse.quote('\g<in>').replace('/','%2F') + '">\g<in></a>', d)
|
|
|
|
|
+ return data
|
|
|
|
|
|
|
|
def plusing(conn, name, link, backtype):
|
|
def plusing(conn, name, link, backtype):
|
|
|
curs = conn.cursor()
|
|
curs = conn.cursor()
|
|
@@ -32,12 +28,12 @@ def namumark(conn, title, data, num, in_c, toc_y):
|
|
|
|
|
|
|
|
data += '<script>function folding(num, test = 0) { var fol = document.getElementById(\'folding_\' + num); if(fol.style.display == \'inline-block\' || fol.style.display == \'block\') { fol.style.display = \'none\'; } else { if(num % 3 == 0 && test != 1) { fol.style.display = \'block\'; } else { fol.style.display = \'inline-block\'; } } } </script>'
|
|
data += '<script>function folding(num, test = 0) { var fol = document.getElementById(\'folding_\' + num); if(fol.style.display == \'inline-block\' || fol.style.display == \'block\') { fol.style.display = \'none\'; } else { if(num % 3 == 0 && test != 1) { fol.style.display = \'block\'; } else { fol.style.display = \'inline-block\'; } } } </script>'
|
|
|
|
|
|
|
|
-# if num == 1:
|
|
|
|
|
-# for d4 in backlink:
|
|
|
|
|
-# t = threading.Thread(target = plusing, args = [conn, d4[0], d4[1], d4[2]])
|
|
|
|
|
-# t.start()
|
|
|
|
|
-# t.join()
|
|
|
|
|
-#
|
|
|
|
|
-# conn.commit()
|
|
|
|
|
|
|
+ # if num == 1:
|
|
|
|
|
+ # for d4 in backlink:
|
|
|
|
|
+ # t = threading.Thread(target = plusing, args = [conn, d4[0], d4[1], d4[2]])
|
|
|
|
|
+ # t.start()
|
|
|
|
|
+ # t.join()
|
|
|
|
|
+ #
|
|
|
|
|
+ # conn.commit()
|
|
|
|
|
|
|
|
return data
|
|
return data
|