diff --git a/plugins/akasblog.lua b/plugins/akasblog.lua index 36480fe..bb4d63d 100644 --- a/plugins/akasblog.lua +++ b/plugins/akasblog.lua @@ -77,7 +77,6 @@ local function run(msg, matches) local text, image_url = get_post(post) local receiver = get_receiver(msg) if image_url then - local receiver = get_receiver(msg) local file = download_to_file(image_url) send_photo(receiver, file, ok_cb, false) end diff --git a/plugins/change_pic.lua b/plugins/change_pic.lua index 4cbc88f..da5329c 100644 --- a/plugins/change_pic.lua +++ b/plugins/change_pic.lua @@ -8,7 +8,7 @@ end return { description = "", - usage = {""}, + usage = {"/pic BILDURL"}, patterns = {"^/pic (.*)$"}, run = run, notyping = true diff --git a/plugins/get_txt.lua b/plugins/get_txt.lua index 873ab32..862ca52 100644 --- a/plugins/get_txt.lua +++ b/plugins/get_txt.lua @@ -8,6 +8,6 @@ end return { description = "", usage = "", - patterns = {"^(.*).txt$"}, + patterns = {"^https?://(.*).txt$"}, run = run } \ No newline at end of file diff --git a/plugins/giphy.lua b/plugins/giphy.lua index c0ed7a2..652ffa1 100644 --- a/plugins/giphy.lua +++ b/plugins/giphy.lua @@ -17,7 +17,7 @@ local function get_image(response) end if image.images.original then - return image.original.url + return image.original.mp4 end return nil diff --git a/plugins/pr0gramm.lua b/plugins/pr0gramm.lua deleted file mode 100644 index 3b57d3d..0000000 --- a/plugins/pr0gramm.lua +++ /dev/null @@ -1,43 +0,0 @@ -function is_pr0_url(msg) - local url = split_by_space(msg.text)[1] - print(url) - if string.starts(url, "http://pr0gramm.com/") or string.starts(url, "http://www.pr0gramm.com/") then - return true - else - return false - end -end - - if string.starts(msg.text, 'http://') or string.starts(msg.text, 'https://') then - if is_pr0_url(msg) then - local url = split_by_space(msg.text)[1] - local splited = split(url, "[\\/]+") - for a,x in pairs(splited) do - pr0_id = x - end - r, c, h = http.request("http://pr0gramm.com/api/items/get.json?id="..pr0_id) - local jsondata = json.decode(r) - local items = jsondata["items"] - for a, x in pairs(items) do - if tonumber(x["id"]) == tonumber(pr0_id) then - item = x - end - end - thumburl = item["thumb"] - local thumburlsplit = split(thumburl, "[\\/]+") - for a, x in pairs(thumburlsplit) do - thumbname = x - end - local file = "/tmp/"..thumbname - sh = "curl --insecure -o '"..file.."' ".."http://img.pr0gramm.com/"..thumburl - run_bash(sh) - send_photo(get_receiver(msg), file, ok_cb, false) - end - end - -return { - description = "", - usage = {""}, - patterns = {"https?://pr0gramm.com/"}, - run = run -} \ No newline at end of file diff --git a/plugins/special.lua b/plugins/special.lua index 03ea0ef..27592db 100644 --- a/plugins/special.lua +++ b/plugins/special.lua @@ -119,6 +119,9 @@ function run(msg, matches) elseif string.match(msg.text, "[Mm][Uu]") then return 'schi' + elseif string.match(msg.text, "[Ii][Yy][Kk][Ww][Ii][Mm]") then + return '(¬‿¬)' + end end @@ -157,7 +160,8 @@ return { "^[Ii][Nn][Ll][Oo][Vv][Ee]$", "^[Pp][Ee]$", "^[Vv][Aa]$", - "^[Mm][Uu]$" + "^[Mm][Uu]$", + "^/[Ii][Yy][Kk][Ww][Ii][Mm]$" }, run = run } diff --git a/plugins/url_title.lua b/plugins/url_title.lua index ae5ed1a..fe42f2f 100644 --- a/plugins/url_title.lua +++ b/plugins/url_title.lua @@ -90,6 +90,7 @@ function run(msg, matches) string.match(msg.text, "steamcommunity.com/app/") or string.match(msg.text, "myanimelist.net/anime/") or string.match(msg.text, "myanimelist.net/manga/") or + string.match(msg.text, "myanimelist.net/profile/") or string.match(msg.text, "deviantart.com") or string.match(msg.text, "urbanup.com/") or string.match(msg.text, "urbandictionary.com/define.php")or @@ -98,6 +99,7 @@ function run(msg, matches) string.match(msg.text, "openings.moe/%?video") or string.match(msg.text, "myfigurecollection.net") or string.match(msg.text, "dropbox.com/s/") or + string.match(msg.text, "nicovideo.jp/watch/sm") or string.ends(url, ".jpg") or string.ends(url, ".jpeg") or string.ends(url, ".gif") or diff --git a/plugins/youtube.lua b/plugins/youtube.lua index c047112..15d2a6b 100644 --- a/plugins/youtube.lua +++ b/plugins/youtube.lua @@ -61,7 +61,7 @@ end function send_youtube_data(data, receiver, link, sendpic) local title = data.snippet.localized.title - -- local description = data.snippet.localized.description + --local description = data.snippet.localized.description local uploader = data.snippet.channelTitle local viewCount = comma_value(data.statistics.viewCount) if data.statistics.likeCount then @@ -87,7 +87,8 @@ function send_youtube_data(data, receiver, link, sendpic) local hours = math.floor(totalseconds / 3600) local duration = string.format("%02d:%02d:%02d", hours, minutes, seconds) - text = 'Titel: '..title..'\nUploader: '..uploader..'\nAufrufe: '..viewCount..'\nLänge: '..duration..' Stunden\nLikes: '..likeCount..'\nDislikes: '..dislikeCount..'\nKommentare: '..commentCount..'\n' + --text = 'Titel: '..title..'\nUploader: '..uploader..'\nAufrufe: '..viewCount..'\nLänge: '..duration..' Stunden\nLikes: '..likeCount..'\nDislikes: '..dislikeCount..'\nKommentare: '..commentCount..'\n' + text = '"'..title..'" hochgeladen von "'..uploader..'"\n'..viewCount..' Aufrufe, Länge: '..duration..' Stunden, '..likeCount..' Likes und '..dislikeCount..' Dislikes, '..commentCount..' Kommentare\n\n' if link then text = link..'\n'..text end diff --git a/plugins/youtube_channel.lua b/plugins/youtube_channel.lua index 0c94c32..d4dddbe 100644 --- a/plugins/youtube_channel.lua +++ b/plugins/youtube_channel.lua @@ -25,7 +25,6 @@ function send_yt_channel_data(data, receiver) local description = data.snippet.localized.description local views = comma_value(data.statistics.viewCount) local subscriber = comma_value(data.statistics.subscriberCount) - if subscriber == "0" then subscriber = "0 (ausgblendet?)" end local videos = comma_value(data.statistics.videoCount) local text = name..' hat '..views..' Video-Aufrufe insgesamt, '..subscriber..' Abonnenten und '..videos..' Videos\n'..description send_msg(receiver, text, ok_cb, false) diff --git a/plugins/youtube_dl.lua b/plugins/youtube_dl.lua index 8bff00e..ea57ed9 100644 --- a/plugins/youtube_dl.lua +++ b/plugins/youtube_dl.lua @@ -13,6 +13,8 @@ function run(msg, matches) video = string.match(text, 'Merging formats into "tmp/(.*)"') if not video then file = string.match(text, '%[download%] (.*) has already been downloaded') + --else + --file = string.match(text, '%[download%] Destination: (.*).flv') else file = 'tmp/'..video end