gitmyhub

TopList

Go ★ 4.7k updated 3y ago

今日热榜,一个获取各大热门网站热门头条的聚合网站,使用Go语言编写,多协程异步快速抓取信息,预览:https://mo.fish

A self-hosted Go application that aggregates trending headlines from major Chinese platforms like Zhihu and Hupu into one page, a crawler fetches data hourly via cron, a web server displays it.

GoMySQLJavaScriptsetup: hardcomplexity 4/5

TopList (also called Today's Hot List, or in Chinese: 今日热榜) is a website aggregator that collects trending headlines from several major Chinese online communities and displays them in one place. It pulls live data from platforms such as Zhihu (a Chinese Q&A site), Hupu, and others, giving users a single page to scan what is popular across multiple sites at once.

The project is written in Go and splits its work between two programs. One program is a crawler that fetches fresh trending data from each source site. It runs on a scheduled task, typically once per hour, using the server's built-in job scheduler (cron). The other program is a web server that takes the stored data and serves it to visitors through a browser interface and a simple API.

Data is stored in a MySQL database. To set up the project yourself, you compile both programs, create the database using a provided SQL file, edit a configuration file with your database credentials, and then update a JavaScript config file with your server address. After that you start the crawler on a schedule and keep the server running in the background.

The README is written in Chinese and includes setup steps, a directory layout, and API documentation with example responses. The API returns JSON and allows callers to fetch a list of available source categories and then request the current hot items for any one category. The project is self-hosted, meaning you run it on your own server rather than relying on any external service.

Where it fits