1.3.3 • Published 7 months ago

web-fetch v1.3.3

Weekly downloads
-
License
LGPL-3.0
Repository
github
Last release
7 months ago

Web fetch

Asset Crawler for common Web pages

CI & CD

NPM

Usage

As a Node.js package

import { savePage } from 'web-fetch';

savePage({
    source: 'http://URL.to/one/of/your/old/posts/'
});

Docker example

https://github.com/kaiyuanshe/KYS-service

As a Command Line tool

web-fetch http://URL.to/one/of/your/old/posts/

In GitHub actions

name: Fetch Web pages
on:
    issues:
        types:
            - opened
jobs:
    Fetch-and-Save:
        runs-on: ubuntu-latest
        permissons:
            contents: write
            issues: write
        steps:
            - uses: actions/checkout@v3

            - uses: pnpm/action-setup@v2
              with:
                  version: 8
            - uses: actions/setup-node@v3
              with:
                  node-version: 18
                  cache: pnpm
            - uses: browser-actions/setup-chrome@v1

            - name: Setup Web-fetch
              run: pnpm i web-fetch -g

            - name: Fetch first URL in Issue Body
              run: web-fetch $(echo "${{ github.event.issue.Body }}" | grep -Eo "https?://\S+")

            - uses: stefanzweifel/git-auto-commit-action@v5
              with:
                  commit_message: '${{ github.event.issue.title }}'

Supported Structure

https://github.com/TechQuery/Web-fetch/blob/master/source/config.ts#L10-L29

Renderer

  1. Puppeteer (default)

  2. JSDOM

Wrapper

  1. Hexo plugin