Code Monkey home page Code Monkey logo

smex's Introduction

smex

A blazing fast CLI application that processes sitemaps in Go Lang.


GoDoc FOSSA Status smex Go Report Card Coverage Status

Smex is short for SiteMap EXtrator. It can handle various operations related to sitemaps with more being build over time. Smex has grown from the frustration of migrating multiple websites in the past and handling changes in URL semantics and massive amount of assets like images.

Smex supports:

  • extraction of urls
  • process local/remote sitemaps
  • output to csv/json
  • pattern matching on urls
  • extraction of images
  • extraction of video
  • extraction of news
  • basic auth to retrieve sitemap
  • url status checking
  • support sitemap indexes
  • support for sitemaps with multiple languages

Note: smex is not a sitemap validator and would not check the validity of sitemaps against the xsd. It will try to parse the sitemaps on best effort.

asciicast

Usages

Extract

To extract information from sitemap

The following command extracts only the urls from yoast's post sitemaps and prints to stdout

smex extract https://yoast.com/post-sitemap.xml --remote --loc

You can also perform the extraction at a sitemap locally

smex extract ~/Download/sitemap.xml

By default, smex write to stdout. Due to the limited space only important fields are displayed. If you want a full extract of the sitemap, then add --format or -f flag to write to a file, currently smex only support csv & json.

smex extract https://yoast.com/post-sitemap.xml --remote --format csv

To filter the URLs you can supply a valid regex pattern using --pattern or -p flag

smex extract https://yoast.com/post-sitemap.xml --remote --pattern ".*seo.*" --format csv

The --output or -o flag will change the filename (no extension required), this is defaulted to smex-output.(csv|json)

Check

To check the status of the pages

TODO: this feature has not yet being implemented

Help

To get help simply run smex without any commands and flags.

Installation

Using Go

go get -u github.com/hbish/smex

Using Homebrew

brew install hbish/taps/smex

Binary

Currently cross-compiled for:

  • Mac (64 bit)
  • Linux (32/64 bit)
  • Windows (32/64 bit)

Latest versions can be downloaded via Releases.

Documentation

For package documentation please check on pkg.go.dev.

Contribute

Getting the code

Clone the repo

git clone [email protected]:hbish/smex.git

Initialise local environment and install commit hook

make init

Running the source

go run github.com/hbish/smex [command] [flags...]

Running tests

make test

Make the changes, the linter is set up to run when you commit your code, if it passes feel free to submit a PR!

Last Thing

Smex is my first stab at building with Go. If you have any feedback, comments or notice any bugs, I'd be more than happy to consider them through the github issue tracker or better yet send me a pull request!

License

FOSSA Status

smex's People

Contributors

fossabot avatar hbish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

fossabot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.