Skip to content

Commit

Permalink
fixed #425 and updated the Spyse subdomain query
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Jul 9, 2020
1 parent ab617c3 commit 79381da
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 276 deletions.
252 changes: 0 additions & 252 deletions datasrcs/spyse.go

This file was deleted.

24 changes: 0 additions & 24 deletions datasrcs/spyse_test.go

This file was deleted.

49 changes: 49 additions & 0 deletions resources/scripts/api/spyse.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
-- Copyright 2017 Jeff Foley. All rights reserved.
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

local json = require("json")

name = "Spyse"
type = "api"

function start()
setratelimit(2)
end

function vertical(ctx, domain)
if (api == nil or api.key == "") then
return
end

local page, err = request({
url=buildurl(domain),
headers={['Authorization']="Bearer " .. api.key},
})
if (err ~= nil and err ~= "") then
return
end

local resp = json.decode(page)
if (resp == nil or #(resp['data'].items) == 0) then
return
end

for i, item in pairs(resp['data'].items) do
sendnames(ctx, item.name)
end
end

function buildurl(domain)
return "https://api.spyse.com/v3/data/domain/subdomain?limit=100&domain=" .. domain
end

function sendnames(ctx, content)
local names = find(content, subdomainre)
if names == nil then
return
end

for i, v in pairs(names) do
newname(ctx, v)
end
end

0 comments on commit 79381da

Please sign in to comment.