Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tool_matrixbot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
FOSS-AG
tool_matrixbot
Commits
29460c7d
Commit
29460c7d
authored
Feb 18, 2019
by
Jonas Schürmann
Browse files
Options
Downloads
Patches
Plain Diff
Only output first date
parent
28595e3e
No related branches found
No related tags found
1 merge request
!2
Soup
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
klo/klo.py
+10
-13
10 additions, 13 deletions
klo/klo.py
with
10 additions
and
13 deletions
klo/klo.py
+
10
−
13
View file @
29460c7d
...
...
@@ -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
'
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment