Skip to content
Snippets Groups Projects
Commit 29460c7d authored by Jonas Schürmann's avatar Jonas Schürmann
Browse files

Only output first date

parent 28595e3e
No related branches found
No related tags found
1 merge request!2Soup
......@@ -8,27 +8,24 @@ import requests
def find_room():
html = requests.get("https://foss-ag.de/").text
soup = BeautifulSoup(html, 'html.parser')
dates = [
li.get_text().strip()
for li in
return (
soup
.find(id="ag-termine")
.find_next_sibling("div")
.find("ul")
.find_all("li")
]
for date in dates:
print(date)
.find_all("li")[0]
.get_text()
.strip()
)
# Called when a message is recieved.
def on_message(room, event):
if event['type'] == "m.room.message":
if event['content']['msgtype'] == "m.text":
print(find_room())
print("{0}: {1}".format(event['sender'], event['content']['body']))
def main():
find_room()
return
client = MatrixClient("https://matrix.org")
token = client.login(username="foss-ag_klo", password=os.environ['KLO_PW'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment