Fixing the excuse thing. Looks like the original list i was pulling from got taken down
This commit is contained in:
parent
82fddef8a0
commit
3505fb33e2
@ -1,6 +1,8 @@
|
||||
import random, requests
|
||||
from bs4 import BeautifulSoup
|
||||
import requests
|
||||
|
||||
def get_excuse():
|
||||
url = ("https://gist.githubusercontent.com/AndrewBrinker/6763cdd5d79d6e" \
|
||||
"3eaa3f/raw/624b946ebcca71ac76b74afa5ea41280540c1b97/excuses.txt")
|
||||
return random.choice(requests.get(url).text.split("\n"))
|
||||
url = requests.get('http://www.devexcuses.com')
|
||||
soup = BeautifulSoup(url.content, features="html.parser")
|
||||
|
||||
return "```{}```".format(str(soup.find("p", {"class": "excuse"}).contents[0]).split(">")[1].split("</a")[0])
|
Loading…
x
Reference in New Issue
Block a user