sitemap-parser
Golang sitemap parser for .xml and .gz
Install
go get github.com/Z-M-Huang/sitemap-parser
Example
Get Index
index, err := sitemap.GetIndex("https://raw.githubusercontent.com/Z-M-Huang/sitemap-parser/master/test/sample_index.xml")
Get Sitemap
index, err := sitemap.GetSitemap("https://raw.githubusercontent.com/Z-M-Huang/sitemap-parser/master/test/sample_index.xml")
Get Sitemap in GZ
index, err := sitemap.GetSitemapGZ("https://github.com/Z-M-Huang/sitemap-parser/raw/master/test/sample_sitemap.xml.gz"")
Get All Sitemaps in Index
index, _ := sitemap.GetIndex("https://raw.githubusercontent.com/Z-M-Huang/sitemap-parser/master/test/sample_index.xml")
sitemaps, err := index.GetSitemaps()