remove newlines from page title, only show 100 characters of the title
This commit is contained in:
parent
e19a147521
commit
b7f777bd0a
1 changed files with 2 additions and 2 deletions
|
@ -658,7 +658,7 @@ while True:
|
||||||
if content_type in allowedparse:
|
if content_type in allowedparse:
|
||||||
if e.ok:
|
if e.ok:
|
||||||
soup = BeautifulSoup(e.text, 'html.parser')
|
soup = BeautifulSoup(e.text, 'html.parser')
|
||||||
multiline("(" + nick + ") " + (soup.title.string if soup.title != None else "[No title provided]"), channel)
|
multiline("(" + nick + ") " + (soup.title.string.rstrip()[:100] if soup.title != None else "[No title provided]"), channel)
|
||||||
else:
|
else:
|
||||||
multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel)
|
multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel)
|
||||||
else:
|
else:
|
||||||
|
@ -676,7 +676,7 @@ while True:
|
||||||
if content_type in allowedparse:
|
if content_type in allowedparse:
|
||||||
if e.ok:
|
if e.ok:
|
||||||
soup = BeautifulSoup(e.text, 'html.parser')
|
soup = BeautifulSoup(e.text, 'html.parser')
|
||||||
multiline("(" + nick + ") " + (soup.title.string if soup.title != None else "[No title provided]"), channel)
|
multiline("(" + nick + ") " + (soup.title.string.rstrip()[:100] if soup.title != None else "[No title provided]"), channel)
|
||||||
else:
|
else:
|
||||||
multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel)
|
multiline("(" + nick + ") [HTTP " + str(e.status_code) + "]", channel)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue