Skip to content

Commit

Permalink
Cleanup urlTitle.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelortmann committed Jun 12, 2024
1 parent d58f563 commit d8000ab
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit d8000ab

Please sign in to comment.