github-page-parser

command module
v0.0.0-...-4f422af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2021 License: MIT Imports: 8 Imported by: 0

README

Github Pages 静态化工具 - blogParser

介绍

本工具用于将部署在 Github Pages 的静态博客爬取并保存为静态文件(HTML、CSS、JS、TTF、图片等),以在方便的在云平台使用 Nginx 等静态 Web 服务器进行部署,提高国内主机到站点的访问速度。

软件架构

基于 go 1.16 开发,没有除标准库其他的依赖。本质来说,就是从主页开始,对每个 HTML 的可点击链接、CSS 中引用的资源都进行爬取并递归进行处理,直到所有站内资源都被下载到本地。

使用说明

直接运行 go run blogParser.go 即可,在 main 函数中修改生成资源的位置和需要爬取的 Github Page URL。

TODO
  • 使用 goroutine 加速爬取(暂时搁置,云平台单核心运行,且访问外网速度慢,并行不能带来大幅度性能提升)
  • Github Webhooks 触发自动解析
  • 提供一种机制,使得某些未被修改的资源不用爬取更新,而非每次都将目录整个删除整个网站重新爬取

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL