{"id":39534135,"url":"https://github.com/zituocn/ziva","last_synced_at":"2026-01-18T06:31:54.945Z","repository":{"id":64298547,"uuid":"566760455","full_name":"zituocn/ziva","owner":"zituocn","description":"A golang crawler framework","archived":false,"fork":false,"pushed_at":"2023-03-21T02:56:08.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T17:09:12.065Z","etag":null,"topics":["crawler","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zituocn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-16T11:12:06.000Z","updated_at":"2023-02-02T09:21:51.000Z","dependencies_parsed_at":"2024-06-20T17:08:33.161Z","dependency_job_id":null,"html_url":"https://github.com/zituocn/ziva","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zituocn/ziva","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zituocn%2Fziva","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zituocn%2Fziva/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zituocn%2Fziva/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zituocn%2Fziva/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zituocn","download_url":"https://codeload.github.com/zituocn/ziva/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zituocn%2Fziva/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28531997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crawler","go","golang"],"created_at":"2026-01-18T06:31:54.782Z","updated_at":"2026-01-18T06:31:54.929Z","avatar_url":"https://github.com/zituocn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ziva\n\n一个go实现的多任务、多线程爬虫库\n\n\n## 一个demo\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/zituocn/ziva\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tjob := ziva.NewJob(\"article\", ziva.Options{\n\t\tCreateQueue: func() ziva.TodoQueue {\n\t\t\tids := []int{3263, 3262, 3261, 3260, 3259}\n\t\t\tqueue := ziva.NewMemQueue()\n\t\t\theader := \u0026http.Header{}\n\t\t\theader.Set(\"User-Agent\", \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\")\n\t\t\tfor _, item := range ids {\n\t\t\t\tqueue.Add(\u0026ziva.Task{\n\t\t\t\t\tUrl:    fmt.Sprintf(\"%s%d\", \"https://22v.net/article/\", item),\n\t\t\t\t\tMethod: \"GET\",\n\t\t\t\t\tHeader: header,\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn queue\n\t\t},\n\t\tSucceedFunc: func(ctx *ziva.Context) {\n\t\t\tfmt.Println(\"成功的回调\")\n\t\t\tfmt.Println(\"返回信息 :\", ctx.Response.Status)\n\t\t},\n\t\tFailedFunc: func(ctx *ziva.Context) {\n\t\t\tfmt.Println(\"失败的回调\")\n\t\t\tfmt.Println(\"返回状态 :\", ctx.Response.StatusCode)\n\t\t},\n\t\tSheepTime: 3000,\n\t\tNum:       1,\n\t})\n\n\tjob.Do()\n}\n\n```\n\n## 使用redis queue\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/zituocn/ziva\"\n\t\"github.com/zituocn/ziva/goredis\"\n)\n\nfunc main() {\n\tjob := ziva.NewJob(\"article\", ziva.Options{\n\t\tCreateQueue: func() ziva.TodoQueue {\n\t\t\tids := []int{3263, 3262, 3261, 3260, 3259}\n\t\t\tqueue := ziva.NewRedisQueue(\"article\", \u0026goredis.RedisConfig{\n\t\t\t\tName:     \"127.0.0.1\",\n\t\t\t\tHost:     \"127.0.0.1\",\n\t\t\t\tPort:     6379,\n\t\t\t\tPassword: \"123456\",\n\t\t\t\tDB:       1,\n\t\t\t})\n\t\t\theader := \u0026http.Header{}\n\t\t\theader.Set(\"User-Agent\", \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\")\n\t\t\tfor _, item := range ids {\n\t\t\t\tqueue.Add(\u0026ziva.Task{\n\t\t\t\t\tUrl:    fmt.Sprintf(\"%s%d\", \"https://22v.net/article/\", item),\n\t\t\t\t\tMethod: \"GET\",\n\t\t\t\t\tHeader: header,\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn queue\n\t\t},\n\t\tSucceedFunc: func(ctx *ziva.Context) {\n\t\t\tfmt.Println(\"成功的回调\")\n\t\t\tfmt.Println(\"返回信息 :\", ctx.Response.Status)\n\t\t},\n\t\tFailedFunc: func(ctx *ziva.Context) {\n\t\t\tfmt.Println(\"失败的回调\")\n\t\t\tfmt.Println(\"返回状态 :\", ctx.Response.StatusCode)\n\t\t},\n\t\tSheepTime: 3000,\n\t\tIsDebug:   true,\n\t\tNum:       1,\n\t})\n\n\tjob.Do()\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzituocn%2Fziva","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzituocn%2Fziva","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzituocn%2Fziva/lists"}