New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/Neko2h/sitemaps

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Neko2h/sitemaps

  • v0.0.0-20230518071058-dfe7ac2f96c6
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go sitemaps

Easy way to work with xml sitemaps

Features

  • Parsing sitemaps
  • Parsing sitemaps Indexes
  • Getting count of urls
  • Getting count of files
  • Concurrency
  • Zero dependencies
  • GZIP support
  • Image, Video suport

Installation

go get github.com/neko2h/go-sitemaps

Usage

To simply parse sitemap Index

	total, err := sitemaps.Parse("https://somesite.com/sitemap.xml", 100, true, "index", func(e sitemaps.Entity) {
		//handle results
	})

To parse sitemap


	total, err := sitemaps.Parse("https://somesite.com/sitemap.xml", 100, true, "sitemap", func(e sitemaps.Entity) {
		//handle results
	})

Concurent parsing ALL links from all sitemaps

	var results []sitemaps.Entity
	total, err := sitemaps.Parse("https://www.ebay.com/lst/VIS-0-index.xml", 100, true, "index", func(e sitemaps.Entity) {
		results = append(results, e)
	})
	if err != nil {
		//err handling
	}

	sitemaps.GetUrls(results, 6, 100, func(e sitemaps.Entity) {
		//handle results
	})

This library is using worker pool algorithm. Since the library is using xml decoder it's fast and me memory efficient

TODO

  • Benchmarking
  • Tests!

License

MIT

FAQs

Package last updated on 18 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc