项目作者: wabarc

项目描述 :
Archiving webpages
高级语言: TypeScript
项目地址: git://github.com/wabarc/archiver.git
创建时间: 2020-10-16T15:56:52Z
项目社区:https://github.com/wabarc/archiver

开源协议:GNU General Public License v3.0

下载


archiver

Read this in other languages: English | 简体中文

Archive webpages from Telegram channel and etc.

Installation

Using npm:

  1. npm install @wabarc/archiver

Using yarn:

  1. yarn add @wabarc/archiver

Example

  1. import { Archiver } from '@wabarc/archiver';
  2. // const archiver = require('@wabarc/archiver');
  3. const archived = await new Archiver().telegram({ channel: 'channel_name', msgid: 1 }).start();
  4. console.log(archived)

Instance methods

The available instance methods are listed below.

  • archiver#telegram({ channel: string, msgid: number })
  • archiver#start()
  • archiver#do()
  • archiver#stage()

Request Params

Telegram

These are the available options for archival webpage from Telegram channel. channel and msgid is required.

  1. {
  2. // `channel` is the Telegram channel name
  3. channel: 'wabarc_testing',
  4. // `msgid` is the message id published on the Telegram channel.
  5. msgid: 1
  6. }

Response Schema

  1. [
  2. {
  3. id: 1,
  4. url: 'https://example.org/',
  5. title: 'Example ORG',
  6. content: '<html><head></head><body>body content</body></html>',
  7. success: true
  8. }
  9. ]

License

This software is released under the terms of the GNU General Public License v3.0. See the LICENSE file for details.