web-fetch
TypeScript icon, indicating that this package has built-in type declarations

1.3.3 • Public • Published

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

Package Sidebar

Install

npm i web-fetch

Weekly Downloads

0

Version

1.3.3

License

LGPL-3.0

Unpacked Size

33.8 kB

Total Files

19

Last publish

Collaborators

  • tech_query