Skip to content

wabarc/archiver

archiver

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

Archive webpages from Telegram channel and etc.

Installation

Using npm:

npm install @wabarc/archiver

Using yarn:

yarn add @wabarc/archiver

Example

import { Archiver } from '@wabarc/archiver';
// const archiver = require('@wabarc/archiver');

const archived = await new Archiver().telegram({ channel: 'channel_name', msgid: 1 }).start();
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.

{
  // `channel` is the Telegram channel name
  channel: 'wabarc_testing',

  // `msgid` is the message id published on the Telegram channel.
  msgid: 1
}

Response Schema

[
  {
    id: 1,
    url: 'https://example.org/',
    title: 'Example ORG',
    content: '<html><head></head><body>body content</body></html>',
    success: true
  }
]

License

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