Giter Club home page Giter Club logo

sitemapper's Introduction

SiteMapper

Produces a site map that contains the publicly reachable links and assets for all pages within the specified domain.

A URL is considered to be in the specified domain if the protocol and host match exactly. For example, https://foo.com and https://foo.com/docs are considered to be in the same domain, however http://foo.com and https://bar.com are not.

At each step of the web crawl, we retrieve the HTML content for the page and parse it for all links and assets. These individual page maps are compiled together to create the final site map. Note that while all links and assets are included in a page map, only links that belong to the specified domain are crawled and thus produce their own page map.

Two methods are provided to create a site map for a particular domain, which are detailed below.

CLI

A CLI is provided to create a site map easily from the command line. Assuming this package has been installed via go install

cli --site INITIAL_URL --workers NUM_WORKERS --file OUTPUT_FILE

As an example, to produce a site map for foo.com using 100 workers and save it to sitemap.json

cli --site https://foo.com --workers 100 --file sitemap.json

API

A REST API has also been provided. Assuming this package has been installed via go install

api --port PORT

As an example, to run the server on port 8000

api --port 8000

With the server running, site maps are created via a simple GET request

GET http://localhost:8000/sitemap?site=INITIAL_URL&workers=NUM_WORKERS

As an example, to produce a site map for foo.com using 100 workers

GET http://localhost:8000/sitemap?site=https://foo.com&workers=100

Prototype - GUI

When running the API server, additionally specify the path to the static gui directory of this repository. For example

api --port 8000 --static sitemapper/gui

With the API server running, visit http://localhost:8000 in your preferred browser. After filling out the form to specify the initial URL and number of workers, the site map will be displayed as an interactive graph.

Dark blue nodes represent web pages that belong to the domain, while gray nodes represent pages outside the domain. Light blue nodes are assets, such as images and javascript libraries. Hovering over a node displays the URL for that node.

site map example

sitemapper's People

Contributors

jordanpotter avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

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.