GithubHelp home page GithubHelp logo

wbdl's Introduction

wbdl

crawl and archive a website and all its pages as plain HTML files organized in directories to match the URL structure of the website.

the simplest intended usage is as a shell script:

npx wbdl https://websitetoarchive.net

this will print out the path to the folder containing the website archive that is created on your filesystem. you can also have the utility open up the resulting folder via the --open CLI flag:

npx wbdl --open https://another.website.org

the utility can also be installed as a node.js package and invoked programatically. to install via npm:

npm install --save wbdl

or yarn:

yarn add wbdl

then to import and use it:

import { wbdl } from 'wbdl';

const pathToArchive = await wbdl(urlString);

here’s the jsdoc signature for the wbdl function (using typescript’s jsdoc type annotations):

/**
 * Takes a URL, downloads its HTML, and crawls it for any links to other pages
 * on the same domain. It then repeats the process for any link it finds. Each
 * page is stored as an index.html file in a directory structure based on the
 * hierarchy of their URLs. Lastly, it compresses the website into a ZIP file
 * and returns the path to the generated archive.
 *
 * @param {string} url The initial URL to crawl
 * @returns {Promise<string>} Path to the generated ZIP file
 */

wbdl's People

Contributors

acusti avatar

Watchers

 avatar  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.