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