Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup urlTitle.py #1611

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mod/python.mod/scripts/urlTitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from eggdrop import bind

# Load any Tcl commands you want to use from the eggdrop.tcl module.
from eggdrop.tcl import putmsg, putlog
from eggdrop.tcl import putmsg

# Load a python module as usual.
from bs4 import BeautifulSoup
Expand All @@ -17,7 +17,7 @@ def pubGetTitle(nick, host, handle, channel, text, **kwargs):
try:
reqs = requests.get(text)
soup = BeautifulSoup(reqs.text, 'html.parser')
putmsg(channel, "The title of the webpage is: "+soup.find_all('title')[0].get_text())
putmsg(channel, "The title of the webpage is: " + soup.title.string)
except Exception as e:
putmsg(channel, "Error: " + str(e))

Expand Down