removed unused plugins
This commit is contained in:
parent
7e825f7363
commit
43eebda05d
4
.gitignore
vendored
4
.gitignore
vendored
@ -18,12 +18,9 @@ plugins/pagespeed_insights.lua
|
|||||||
plugins/ping_adress.lua
|
plugins/ping_adress.lua
|
||||||
plugins/test.lua
|
plugins/test.lua
|
||||||
plugins/twitch.lua
|
plugins/twitch.lua
|
||||||
plugins/create_sticker.lua
|
|
||||||
plugins/derpibooru_nsfw.lua
|
plugins/derpibooru_nsfw.lua
|
||||||
plugins/derpibooru.lua
|
plugins/derpibooru.lua
|
||||||
plugins/meme.lua
|
|
||||||
plugins/app_store.lua
|
plugins/app_store.lua
|
||||||
plugins/bitly_create.lua
|
|
||||||
plugins/dailymotion.lua
|
plugins/dailymotion.lua
|
||||||
plugins/dns.lua
|
plugins/dns.lua
|
||||||
plugins/gdrive.lua
|
plugins/gdrive.lua
|
||||||
@ -37,7 +34,6 @@ plugins/vine.lua
|
|||||||
plugins/youtube_playlist.lua
|
plugins/youtube_playlist.lua
|
||||||
plugins/yandere.lua
|
plugins/yandere.lua
|
||||||
plugins/e621.lua
|
plugins/e621.lua
|
||||||
plugins/random.lua
|
|
||||||
plugins/ponyfaces.lua
|
plugins/ponyfaces.lua
|
||||||
plugins/rss_old.lua
|
plugins/rss_old.lua
|
||||||
README - Kopie.md
|
README - Kopie.md
|
@ -1,94 +0,0 @@
|
|||||||
local max_characters = 1000
|
|
||||||
local display_thread_subject = true -- Doesn't count for max_characters
|
|
||||||
local send_image = true
|
|
||||||
|
|
||||||
|
|
||||||
local function html2text(data)
|
|
||||||
data = string.gsub(data, "<br><br>", "\n")
|
|
||||||
data = string.gsub(data, "<br>", "\n")
|
|
||||||
data = string.gsub(data, "<a.->", " ")
|
|
||||||
data = string.gsub(data, "</a>", " ")
|
|
||||||
data = string.gsub(data, "<p.->(.-)</p>", "%1\n")
|
|
||||||
data = string.gsub(data, "<b.->", "")
|
|
||||||
data = string.gsub(data, "</b>", "")
|
|
||||||
data = string.gsub(data, "<i.->", "")
|
|
||||||
data = string.gsub(data, "</i>", "")
|
|
||||||
data = string.gsub(data, "<sup.->", "")
|
|
||||||
data = string.gsub(data, "</sup>", "")
|
|
||||||
data = string.gsub(data, "<span.->", "\n")
|
|
||||||
data = string.gsub(data, "</span>", "\n")
|
|
||||||
data = string.gsub(data, "<div.->(.-)</div>", "%1\n")
|
|
||||||
--data = string.gsub(data, "[.-]", "")
|
|
||||||
data = string.gsub(data, "<table.->.-</table>", "")
|
|
||||||
data = string.gsub(data, "<li.->(.-)</li>", " - %1\n")
|
|
||||||
data = string.gsub(data, "<.->", "")
|
|
||||||
data = string.gsub(data, ">", ">")
|
|
||||||
data = string.gsub(data, "&", "&")
|
|
||||||
data = string.gsub(data, "&..;", "")
|
|
||||||
data = string.gsub(data, "&...;", "")
|
|
||||||
data = string.gsub(data, "&....;", "")
|
|
||||||
return data
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function get4chanRandomThread()
|
|
||||||
local api = "http://a.4cdn.org/vg/catalog.json"
|
|
||||||
local res, code = http.request(api)
|
|
||||||
if code ~= 200 then return nil end
|
|
||||||
local jsonCatalog = json:decode(res)
|
|
||||||
|
|
||||||
local data = jsonCatalog
|
|
||||||
if not data then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
if #data == 0 then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Random page from catalog
|
|
||||||
local i = math.random(#data)
|
|
||||||
local page = data[i]
|
|
||||||
if not page then
|
|
||||||
print("page = nil")
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
if #page.threads == 0 then
|
|
||||||
print("#page.threads = 0")
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
--Random thread from page
|
|
||||||
local j = math.random(#page.threads)
|
|
||||||
local thread = page.threads[j]
|
|
||||||
return thread
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function run(msg, matches)
|
|
||||||
local receiver = get_receiver(msg)
|
|
||||||
local thread = get4chanRandomThread()
|
|
||||||
if thread == nil then return "ERROR!" end
|
|
||||||
if thread.com == nil then return "ERROR!" end
|
|
||||||
local text = thread.com
|
|
||||||
text = string.gsub(text, "<a href=\"/.-\" class=\"quotelink\">.-</a>", "")
|
|
||||||
text = string.gsub(text, "%s.-%sThread", "")
|
|
||||||
text = html2text(text)
|
|
||||||
if string.len(text) >= max_characters then
|
|
||||||
text = string.sub(text, 1, max_characters).."\n[...]"
|
|
||||||
end
|
|
||||||
|
|
||||||
if thread.tim ~= nill and thread.ext ~= nil and send_image then
|
|
||||||
send_photo_from_url(get_receiver(msg), "http://i.4cdn.org/vg/"..thread.tim..thread.ext)
|
|
||||||
end
|
|
||||||
if thread.sub ~= nill and display_thread_subject then
|
|
||||||
text = thread.sub..":\n"..text
|
|
||||||
end
|
|
||||||
return text
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
description = "Get a random thread.",
|
|
||||||
usage = "/4chan: get a random thread",
|
|
||||||
patterns = {"^/4chan$"},
|
|
||||||
run = run
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
do
|
|
||||||
|
|
||||||
function getRouterStatus(attempt)
|
|
||||||
command = "curl 'https://www.pcfactory.cl/ordenservicio' -H 'Pragma: no-cache' -H 'Origin: https://www.pcfactory.cl' -H 'Accept-Encoding: gzip,deflate' -H 'Accept-Language: en-US,en;q=0.8,es;q=0.6' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: no-cache' -H 'Referer: https://www.pcfactory.cl/ordenservicio' -H 'Cookie: PHPSESSID=i96mfj26t2cjgimojv08m7n934; SphinxID=5548c195553200.30873318; sphinxCONTACTO=0; __asc=014d05c814d24321517a9255ba1; __auc=2fe469c51466d6c6237c3ff1a1c' -H 'Connection: keep-alive' --data '%40sphinx=ORDENSERVICIO&rut=76247226-0&buscar=Buscar' --compressed | grep 'masinfo'"
|
|
||||||
-- aRouterStatusattempt = attempt or 0
|
|
||||||
-- attempt = attempt + 1
|
|
||||||
|
|
||||||
-- local res,status = http.request("")
|
|
||||||
|
|
||||||
-- if status ~= 200 then return nil end
|
|
||||||
-- local data = json:decode(res)[1]
|
|
||||||
|
|
||||||
-- -- The OpenBoobs API sometimes returns an empty array
|
|
||||||
-- if not data and attempt < 10 then
|
|
||||||
-- print('Cannot get router status...')
|
|
||||||
-- return getRouterStatus(attempt)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
local handle = io.popen(command)
|
|
||||||
local result = handle:read("*a")
|
|
||||||
handle:close()
|
|
||||||
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function run(msg, matches)
|
|
||||||
status = getRouterStatus()
|
|
||||||
|
|
||||||
if status ~= nil then
|
|
||||||
return status
|
|
||||||
else
|
|
||||||
return 'Error getting boobs/butts for you, please try again later.'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
description = "Gets the router status",
|
|
||||||
usage = {
|
|
||||||
"/router",
|
|
||||||
"/router_status",
|
|
||||||
"/routerstatus"
|
|
||||||
},
|
|
||||||
patterns = {
|
|
||||||
"^/router$",
|
|
||||||
"^/router_status$",
|
|
||||||
"^/routerstatus$"
|
|
||||||
},
|
|
||||||
run = run
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
|
Reference in New Issue
Block a user