{"id":15348767,"url":"https://github.com/zuston/spider","last_synced_at":"2025-07-29T09:39:23.283Z","repository":{"id":93117689,"uuid":"63161052","full_name":"zuston/spider","owner":"zuston","description":"php spider of zhihu","archived":false,"fork":false,"pushed_at":"2016-08-02T02:17:20.000Z","size":28,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-24T08:02:04.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zuston.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-07-12T13:40:01.000Z","updated_at":"2016-07-12T13:50:18.000Z","dependencies_parsed_at":"2023-03-24T06:03:07.827Z","dependency_job_id":null,"html_url":"https://github.com/zuston/spider","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"80cf55e5b119c27920da1c5f681abd26300cd449"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zuston/spider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuston%2Fspider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuston%2Fspider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuston%2Fspider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuston%2Fspider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuston","download_url":"https://codeload.github.com/zuston/spider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuston%2Fspider/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267665022,"owners_count":24124441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"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":[],"created_at":"2024-10-01T11:52:06.462Z","updated_at":"2025-07-29T09:39:23.264Z","avatar_url":"https://github.com/zuston.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spider\nphp spider of zhihu\n\n\n# USAGE\n1. 采用sql文件中的db.sql进行建表\n2. 修改db文件中的数据库连接配置\n3. terminal中运行php index.php 和 php viceSpider.php(实在是太简单了)\n\n# 爬虫思路\n采用知乎的cookie进行模拟抓取，根据当前用户抓取自己的个人信息，关注者和被关注者。个人信息放入user表中，用户关系放入relation表中，关注者和被关注者的nick_name放入queue表中（任务队列中）。下一个用户从queue队列中取出未爬取过的用户，继续上一步骤。\n\n### 出现问题\n因为开始写的时候是curl单线程爬取，又因为关注列表需要多次ajax爬取，所以网络io开销很大，queue表填充很快，但是user信息抓取的很慢\n\n#### 解决思路\n开启curl_multi抓取，针对queue队列重新进行副进程进行单用户数据抓取\n\n\n# TODO\n1. 对网络io进行超时暂停、记录时长\n2. 对抓取数据进行图表分析\n3. 代码零零散散加起来有一天时间写完。很乱，结构需改进。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuston%2Fspider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuston%2Fspider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuston%2Fspider/lists"}