Last active
December 12, 2020 16:39
-
-
Save Brawl345/1bd7b5e1cf6f1b38864e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Name": "img.pegelf.de", | |
"RequestType": "POST", | |
"RequestURL": "https://img.pegelf.de/upload.php", | |
"FileFormName": "file[]", | |
"Arguments": {}, | |
"ResponseType": "Text", | |
"RegexList": [ | |
"id=\"codedirect\" value=\"(.+)/di/(.+)\" on", | |
"id=\"deletecode\" value=\"(.+)\" on" | |
], | |
"URL": "$1,1$/di/$1,2$", | |
"ThumbnailURL": "$1,1$/dt/$1,2$", | |
"DeletionURL": "$2,1$" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Proof of Concept. Ausgabe könnte natürlich noch verbessert werden | |
-- Geschrieben von Andreas Bielawski (c) 2015 (wiidatabase.de) | |
-- Plugin für Yagops Telegram-Bot (github.com/yagop/telegram-bot) | |
do | |
local BASE_URL = 'http://rats-ms.de/services' | |
local function get_rats_data (klasse, woche) | |
local url = BASE_URL..'/?Klasse='..klasse..'&kw='..woche..'&format=json' | |
local res,code = http.request(url) | |
if code ~= 200 then return "HTTP-FEHLER" end | |
local data = json:decode(res) | |
return data | |
end | |
local function send_rats_data(data, receiver) | |
local text = '' | |
for wochentag in pairs(data.Tage) do | |
text = text..data.Tage[wochentag].Wochentag..', '..data.Tage[wochentag].Datum..':' | |
for stunden in pairs(data.Tage[wochentag].Stunden) do | |
text = text..'\nStunde(n): '..data.Tage[wochentag].Stunden[stunden].Stunde | |
if data.Tage[wochentag].Stunden[stunden].Hinweis ~= '' then | |
text = text..'\nHinweis: '..data.Tage[wochentag].Stunden[stunden].Hinweis | |
end | |
text = text..'\nKlasse(n): '..data.Tage[wochentag].Stunden[stunden].Klasse | |
if data.Tage[wochentag].Stunden[stunden].Lehrer ~= '---' then | |
text = text..'\nLehrer: '..data.Tage[wochentag].Stunden[stunden].Lehrer | |
end | |
if data.Tage[wochentag].Stunden[stunden].Fach ~= '--- ' then | |
text = text..'\nFach: '..data.Tage[wochentag].Stunden[stunden].Fach | |
end | |
if data.Tage[wochentag].Stunden[stunden].Raum ~= '--- ' then | |
text = text..'\nRaum: '..data.Tage[wochentag].Stunden[stunden].Raum | |
end | |
text = text..'\nStatt: '..data.Tage[wochentag].Stunden[stunden].Statt..'\n' | |
end | |
text = text..'\n' | |
end | |
send_large_msg(receiver, text, ok_cb, false) | |
end | |
local function run(msg, matches) | |
local klasse = matches[1] | |
if matches[2] == nil then | |
woche = os.date("%V") | |
else | |
woche = matches[2] | |
end | |
local data = get_rats_data(klasse, woche) | |
local receiver = get_receiver(msg) | |
send_rats_data(data, receiver) | |
end | |
return { | |
description = "Sendet Vertretungsplan vom RATS.", | |
usage = { | |
"!rats [Klasse]: Sendet Vertretungsplan vom RATS", | |
"!rats [Klasse] [Woche]: Sendet Vertretungsplan vom RATS von der angeg. Woche" | |
}, | |
patterns = { | |
"^!rats (.*) (%d+[%d%.]*)$", | |
"^!rats (.*)$" | |
}, | |
run = run | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" standalone="yes"?> | |
<ShowMiiWads> | |
<Settings> | |
<Version>1.5.2</Version> | |
<Language>English</Language> | |
<LangFile /> | |
<AutoSize>true</AutoSize> | |
<NandPath /> | |
<WiiGamePath /> | |
<ShowPath>true</ShowPath> | |
<AddSub>false</AddSub> | |
<Portable>True</Portable> | |
<Accepted>true</Accepted> | |
<SaveFolders>true</SaveFolders> | |
<CreateBackups>false</CreateBackups> | |
<SplashScreen>true</SplashScreen> | |
<View>ShowMiiWads</View> | |
</Settings> | |
<Window> | |
<WindowWidth>930</WindowWidth> | |
<WindowHeight>396</WindowHeight> | |
<LocationX>214</LocationX> | |
<LocationY>160</LocationY> | |
<WindowState>Normal</WindowState> | |
</Window> | |
<Folders> | |
<MRU0 /> | |
<MRU1 /> | |
<MRU2 /> | |
<MRU3 /> | |
<MRU4 /> | |
<Foldercount>0</Foldercount> | |
</Folders> | |
</ShowMiiWads> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment