iojd
parent
792fd1daab
commit
8c9b8809d3
|
@ -864,9 +864,9 @@ def submit_post(v):
|
||||||
gevent.spawn(archiveorg, new_post.url)
|
gevent.spawn(archiveorg, new_post.url)
|
||||||
|
|
||||||
# archive other urls in post
|
# archive other urls in post
|
||||||
url_regex = '<a href=\"(https?://[a-z]{1,20}\.[^\"]+)\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">(.+)</a>'
|
url_regex = '<a href=\"(https?://[a-z]{1,20}\.[^\"]+)\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">([^\"]+)</a>'
|
||||||
print(new_post.body_html)
|
print(new_post.body_html)
|
||||||
for url_match in re.finditer(url_regex, new_post.body_html):
|
for url_match in re.finditer(url_regex, new_post.body_html, flags=re.M|re.I):
|
||||||
href = url_match.group(1)
|
href = url_match.group(1)
|
||||||
print(href)
|
print(href)
|
||||||
title = url_match.group(2)
|
title = url_match.group(2)
|
||||||
|
|
Loading…
Reference in New Issue