-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
35 lines (25 loc) · 773 Bytes
/
bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
get_recent_changes.py
"""
import requests
bruh_string = None
S = requests.Session()
# chnage URL to /api.php
URL = "https://pl.scpslgame.com/api.php"
# change rclimit to get number of recent changes
PARAMS = {
"format": "json",
"rcprop": "title|ids|flags|user|timestamp|sizes|comment",
"list": "recentchanges",
"action": "query",
"rclimit": "1",
"rctype": "edit|new",
"rcshow": "!minor|!anon"
}
R = S.get(url=URL, params=PARAMS)
DATA = R.json()
RECENTCHANGES = DATA['query']['recentchanges']
# print recent changes
for rc in RECENTCHANGES:
bruh_string = (str(rc['title']) + " at " + str(rc['timestamp']) + " by " + str(rc['user']) + " Comments: " + str(rc['comment']))
print(bruh_string)