Skip to content

Commit

Permalink
Make Pastebin data-source only available with an API key
Browse files Browse the repository at this point in the history
  • Loading branch information
shelld3v committed Jun 25, 2022
1 parent fee5f16 commit b03af20
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion resources/scripts/api/pastebin.ads
Expand Up @@ -10,20 +10,36 @@ function start()
set_rate_limit(1)
end

function check()
local c
local cfg = datasrc_config()
if cfg ~= nil then
c = cfg.credentials
end

if (c ~= nil and c.key ~= nil and c.key ~= "") then
return true
end
return false
end

function vertical(ctx, domain)
local c
local cfg = datasrc_config()
if cfg ~= nil then
c = cfg.credentials
end

if (c == nil or c.key == nil or c.key == "") then
return
end

local resp, err = request(ctx, {url=search_url(domain)})
if (err ~= nil and err ~= "") then
log(ctx, "vertical request to service failed: " .. err)
return
end

send_names(ctx, resp)
if (c == nil or c.key == nil or c.key == "") then
return
end
Expand Down

0 comments on commit b03af20

Please sign in to comment.