MCPcopy
hub / github.com/pingc0y/URLFinder / Res

Function Res

crawler/run.go:250–272  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

248}
249
250func Res() {
251 if len(result.ResultJs) == 0 && len(result.ResultUrl) == 0 {
252 fmt.Println("未获取到数据")
253 return
254 }
255 //打印还是输出
256 if len(cmd.O) > 0 {
257 if strings.HasSuffix(cmd.O, ".json") {
258 result.OutFileJson(cmd.O)
259 } else if strings.HasSuffix(cmd.O, ".html") {
260 result.OutFileHtml(cmd.O)
261 } else if strings.HasSuffix(cmd.O, ".csv") {
262 result.OutFileCsv(cmd.O)
263 } else {
264 result.OutFileJson("")
265 result.OutFileCsv("")
266 result.OutFileHtml("")
267 }
268 } else {
269 UrlToRedirect()
270 result.Print()
271 }
272}
273
274func AppendJs(ur string, urltjs string) int {
275 config.Lock.Lock()

Callers 1

RunFunction · 0.85

Calls 5

OutFileJsonFunction · 0.92
OutFileHtmlFunction · 0.92
OutFileCsvFunction · 0.92
PrintFunction · 0.92
UrlToRedirectFunction · 0.85

Tested by

no test coverage detected