gyyyy / zoomeye-go Goto Github PK
View Code? Open in Web Editor NEWThe Golang SDK and CLI of ZoomEye@Knownsec by gyyyy.
The Golang SDK and CLI of ZoomEye@Knownsec by gyyyy.
当maxPage>5时,比如为10,则采用并发模式。
此时只要其中一页请求有问题,比如搜索结果只有7页,则访问第8页的时候出错,很可能就会没结果。(因为这时候往往第8页返回的最快)
我觉得程序的逻辑是不是可以更好:先访问第一页,看下结果有多少数量和用户有多少额度,然后根据这两个变量来调整maxPage,再进行余下的并发逻辑。
运行的命令:
./ZoomEye-go init -apikey xxx-xxx-xx
failed to initialize: json: cannot unmarshal number 9013.0 into Go struct field .resources.search of type int
看了一下代码,search定义的类型是 int,而源站返回的是 9013.0,非int类型,json转struct时候出错。
相关代码:
type ResourcesInfoResult struct {
baseResult
Plan string json:"plan"
Resources *struct {
Interval string json:"interval"
Search int json:"search"
Stats int json:"stats"
} json:"resources"
}
源站返回的结果:
{"plan": "developer", "resources": {"search": 9013.0, "stats": 100, "interval": "month"}}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.