Skip to content

Commit

Permalink
DDG: remove broken error catching (irc isn't in the _ddgurl namespace)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Lu authored and James Lu committed Nov 1, 2015
1 parent 2cfdb46 commit 52ec05a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions DDG/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ def _ddgurl(self, text):
# DuckDuckGo has a 'lite' site free of unparseable JavaScript
# elements, so we'll use that to our advantage!
url = "https://duckduckgo.com/lite?" + urlencode({"q": text})
try:
data = utils.web.getUrl(url).decode("utf-8")
except utils.web.Error as e:
irc.error(str(e), Raise=True)
data = utils.web.getUrl(url).decode("utf-8")
soup = BeautifulSoup(data)
# Remove "sponsored link" results
return [td for td in soup.find_all('td') if 'result-sponsored' not in str(td.parent.get('class'))]
Expand Down

0 comments on commit 52ec05a

Please sign in to comment.