Skip to content

Commit

Permalink
v0.5 创建项目更便捷
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbug committed May 21, 2021
1 parent 4625176 commit c2cd50b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
9 changes: 8 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ cat domain.txt|biu-cli -pid 项目ID

- 查询备案并添加到已有项目中
```shell
biu-cli -icp xx公司|biu-cli -pid 项目ID
biu-cli -icp xx公司 -pid 项目ID
```


- 查询备案并创建项目
```shell
biu-cli -icp xx公司 -pnew 项目名称
```


- 配合https://opendata.rapid7.com/sonar.https/使用

```shell
Expand Down
17 changes: 14 additions & 3 deletions cmd/biu-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
ip string
pageSize int
client = resty.New()
version = "v0.4"
version = "v0.5"
)

func biuPrint(header []string, data [][]string) {
Expand Down Expand Up @@ -63,9 +63,19 @@ func icpSearch() {
reg, err := regexp.Compile(`<span class="ranking-ym" rel="nofollow">([a-z0-9-\.]+)`)
if err == nil {
match := reg.FindAllString(resp.String(), -1)
for _, domain := range match {
fmt.Println(strings.Split(domain, ">")[1])
if len(match) > 0 {
if pnew != "" {
addProject()
}
for _, domain := range match {
if pid != "" {
addTargetToProject(strings.Split(domain, ">")[1])
} else {
fmt.Println(strings.Split(domain, ">")[1])
}
}
}

}
}
}
Expand Down Expand Up @@ -113,6 +123,7 @@ func addProject() {
msg := gjson.Get(string(resp.Body()), "msg").Value()
fmt.Println(msg)
fmt.Println(result.Get("project_id").Value())
pid = result.Get("project_id").Str
}
}

Expand Down

0 comments on commit c2cd50b

Please sign in to comment.