Plugin für img.akamaru.de
This commit is contained in:
parent
2f93d7968c
commit
4d8fdfe7ce
31
plugins/akamaru_img.lua
Normal file
31
plugins/akamaru_img.lua
Normal file
@ -0,0 +1,31 @@
|
||||
do
|
||||
|
||||
local function get_ponywave(part)
|
||||
local url = 'http://img.akamaru.de/'..part..'.html'
|
||||
local res,code = http.request(url)
|
||||
if code ~= 200 then return "Fehler beim Abrufen von img.ponywave.de" end
|
||||
local url = string.match(res, "id=\"codedirect\" value%=\"(.-)\" onclick")
|
||||
return url
|
||||
end
|
||||
|
||||
local function run(msg, matches)
|
||||
local receiver = get_receiver(msg)
|
||||
local part = matches[1]
|
||||
local url = get_ponywave(part)
|
||||
if string.ends(url, ".gif") then
|
||||
send_document_from_url(receiver, url)
|
||||
else
|
||||
send_photo_from_url(receiver, url)
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Mirrored Bild bei Link auf Preview-Seite von img.akamaru.de",
|
||||
usage = "Preview-Link von img.akamaru.de",
|
||||
patterns = {
|
||||
"https?://img.akamaru.de/(.*).html"
|
||||
},
|
||||
run = run
|
||||
}
|
||||
|
||||
end
|
Reference in New Issue
Block a user