{"id":13486719,"url":"https://github.com/tophubs/TopList","last_synced_at":"2025-03-27T21:30:57.427Z","repository":{"id":37430853,"uuid":"196937459","full_name":"tophubs/TopList","owner":"tophubs","description":"今日热榜，一个获取各大热门网站热门头条的聚合网站，使用Go语言编写，多协程异步快速抓取信息，预览:https://mo.fish","archived":false,"fork":false,"pushed_at":"2023-02-23T02:24:26.000Z","size":5697,"stargazers_count":4685,"open_issues_count":45,"forks_count":951,"subscribers_count":108,"default_branch":"master","last_synced_at":"2024-10-29T15:32:01.627Z","etag":null,"topics":["golang","hot","hotlist","spider","today-s-hot-list"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tophubs.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}},"created_at":"2019-07-15T06:26:39.000Z","updated_at":"2024-10-26T21:40:38.000Z","dependencies_parsed_at":"2022-07-08T18:43:40.976Z","dependency_job_id":"8b1c13b8-47eb-4379-9813-a565ff18b526","html_url":"https://github.com/tophubs/TopList","commit_stats":{"total_commits":56,"total_committers":11,"mean_commits":5.090909090909091,"dds":0.625,"last_synced_commit":"44e550cf3a4bcfe2ec1adc668fa6adb8fd453f9c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tophubs%2FTopList","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tophubs%2FTopList/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tophubs%2FTopList/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tophubs%2FTopList/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tophubs","download_url":"https://codeload.github.com/tophubs/TopList/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222314113,"owners_count":16965428,"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","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":["golang","hot","hotlist","spider","today-s-hot-list"],"created_at":"2024-07-31T18:00:50.282Z","updated_at":"2025-03-27T21:30:57.407Z","avatar_url":"https://github.com/tophubs.png","language":"Go","funding_links":[],"categories":["Go","爬虫"],"sub_categories":[],"readme":"# 今日热榜\n\n**今日热榜是一个获取各大热门网站热门头条的聚合网站，使用Go语言编写，多协程异步快速抓取信息，预览:[http://mo.fish][热榜]**\n\n![DeepinScrot-1130.png](http://img.printf520.com/img/DeepinScrot-1130.png)\n\n### 安装教程\n\n1. 编译\n\n   ```\n   cd {root_path} # 项目根目录\n   go build -o ./App/GetHot App/GetHot.go\n   go build -o ./App/Server App/Server.go \n   ```\n   \n2. 创建数据库，如 `news`，执行database.sql创建表，更改配置文件`Config/mysql.toml`\n\n3. 编辑文件 `Html/js/blog/globalConfig.js`\n\n   ```\n   const ServerIp = 'http://{your_domain}:9090' // 替换成服务器域名\n   ```\n\n4. 部署定时任务/App/GetHot.go爬虫程序，且以守护进程的方式执行Server.go\n\n   ```\n   crontab -e # 添加一行 0 */1 * * * {root_path}/App/GetHot\n   nohup {root_path}/App/Server \u0026\n   ```\n\n5. 测试\n\n   - 打开`http://{yourdomain}:9090/` 即可访问今日热榜\n\n\n### 目录说明\n\n```\nTopList/\n├── App\n│   ├── GetHot.go   爬虫程序需要Cron定时任务执行\n│   └── Server.go   Server程序需要守护进程的方式执行\n├── Common\n│   ├── Db.go       DB组件\n│   └── Message.go  \n├── Config\n│   ├── MySql.go    mysql配置读取组件\n│   └── mysql.toml  mysql配置文件需要手动配置\n├── Cron\n│   ├── GetHot.sh   爬虫Cron程序可以是每小时执行一次\n│   └── README.md\n├── database.sql    数据库建表文件\n├── Html\n│   ├── css\n│   ├── hot.html    前端热榜展示网页\n│   └── js\n│  \n└── README.md\n```\n\n### API说明\n\n#### 获取所有类型\n- Method: **GET**\n- URL:  ```https://www.tophub.fun:8888/GetAllType```\n- Param：无\n- Body:\n```\n{\n    \"Code\":0,\n    \"Message\":\"获取数据成功\",\n    \"Data\":[\n        {\"id\":\"1\",\"sort\":\"63908\",\"title\":\"知乎\"},\n        {\"id\":\"2\",\"sort\":\"21912\",\"title\":\"虎扑\"},\n        {\"id\":\"6\",\"sort\":\"11707\",\"title\":\"天涯\"},\n        {\"id\":\"7\",\"sort\":\"12546\",\"title\":\"知乎日报\"},\n       ]}\n```\n\n\n### 获取具体类型热榜数据\n- Method: **GET**\n- URL:  ```  https://www.tophub.fun:8888/v2/GetAllInfoGzip?id=59\u0026page=0```\n- Param：id\n- Body:\n```\n{\n    \"Code\":0,\n    \"Message\":\"获取数据成功\",\n    \"Data\":{\n        \"data\":[\n            {\n                \"id\":1327371,\n                \"CreateTime\":1579487422,\n                \"commentNum\":0,\n                \"approvalNum\":0,\n                \"Title\":\"180W 买了个小破房，月供 7500 多，压力山大\",\n                \"hotDesc\":\"200条评论\",\n                \"Url\":\"https://www.v2ex.com/t/639366#reply200\",\n                \"imgUrl\":\"\",\n                \"isRss\":\"\",\n                \"is_agree\":0,\n                \"TypeName\":\"社区\"\n            },\n            {\n                \"id\":1326304,\n                \"CreateTime\":1579483806,\n                \"commentNum\":0,\n                \"approvalNum\":0,\n                \"Title\":\"口罩(N95) 目前应该买哪个? 有研究过得推荐一下?\",\n                \"hotDesc\":\"106条评论\",\n                \"Url\":\"https://www.v2ex.com/t/639343#reply106\",\n                \"imgUrl\":\"\",\n                \"isRss\":\"\",\n                \"is_agree\":0,\n                \"TypeName\":\"社区\"\n            },\n        ],\n        \"page\":10\n    }\n}\n```\n\n\n### 使用说明\n\n1. fork 项目\n\n### 参与贡献\n\n1. Fork 本项目\n2. 新建 Feat_xxx 分支\n3. 提交代码\n4. 新建 Pull Request\n\n\n[热榜]: https://www.printf520.com/hot.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftophubs%2FTopList","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftophubs%2FTopList","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftophubs%2FTopList/lists"}