wayback

package module
v0.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

README

Wayback

Go Report Card GitHub Workflow Status Releases LICENSE Docker Automated build wayback

wabarc/wayback is a tool that supports running as a command-line tool and docker container, purpose to snapshot webpage to time capsules.

Installation

$ go get -u github.com/wabarc/wayback/cmd/wayback

Using Snapcraft (on GNU/Linux)

$ sudo snap install wayback

Usage

  • Running as CLI command or Docker container
  • Running with telegram bot
Command line
$ wayback -h
A CLI tool for wayback webpages.

Usage:
  wayback [flags]

Examples:
  wayback https://www.wikipedia.org
  wayback https://www.fsf.org https://www.eff.org
  wayback --ia https://www.fsf.org
  wayback --ip https://www.fsf.org
  wayback --ia --is -d telegram -t your-telegram-bot-token
  WAYBACK_SLOT=pinata WAYBACK_APIKEY=YOUR-PINATA-APIKEY \
    WAYBACK_SECRET=YOUR-PINATA-SECRET wayback --ip https://www.fsf.org

Flags:
  -c, --chatid string      Channel ID. default: ""
  -d, --daemon string      Run as daemon service.
      --debug              Enable debug mode. default: false
  -h, --help               help for wayback
      --ia                 Wayback webpages to Internet Archive.
      --ip                 Wayback webpages to IPFS. (default false)
      --ipfs-host string   IPFS daemon host, do not require, unless enable ipfs. (default "127.0.0.1")
  -m, --ipfs-mode string   IPFS mode. (default "pinner")
  -p, --ipfs-port uint     IPFS daemon port. (default 5001)
      --is                 Wayback webpages to Archive Today.
  -t, --token string       Telegram bot API Token, required.
      --tor                Snapshot webpage use tor proxy.
  -v, --version            version for wayback
Examples

Wayback one or more url to Internet Archive and archive.today:

$ wayback https://www.wikipedia.org

$ wayback https://www.fsf.org https://www.eff.org

Wayback url to Internet Archive or archive.today or IPFS:

// Internet Archive
$ wayback --ia https://www.fsf.org

// archive.today
$ wayback --is https://www.fsf.org

// IPFS
$ wayback --ip https://www.fsf.org

For the IPFS, also can use a specific pinner service:

$ export WAYBACK_SLOT=pinata
$ export WAYBACK_APIKEY=YOUR-PINATA-APIKEY
$ export WAYBACK_SECRET=YOUR-PINATA-SECRET
$ wayback --ip https://www.fsf.org

// or

$ WAYBACK_SLOT=pinata WAYBACK_APIKEY=YOUR-PINATA-APIKEY \
$ WAYBACK_SECRET=YOUR-PINATA-SECRET wayback --ip https://www.fsf.org

TIP: more details about pinner service.

With telegram bot:

$ wayback --ia --is --ip -d telegram -t your-telegram-bot-token

Publish message to your Telegram channel at the same time:

$ wayback --ia --is --ip -d telegram -t your-telegram-bot-token -c your-telegram-channel-name

Also can run with debug mode:

$ wayback -d telegram -t YOUR-BOT-TOKEN --debug
Docker/Podman
$ docker pull wabarc/wayback
$ docker run -d wabarc/wayback -d telegram -t YOUR-BOT-TOKEN # without telegram channel
$ docker run -d wabarc/wayback -d telegram -t YOUR-BOT-TOKEN -c YOUR-CHANNEL-USERNAME # with telegram channel

Deploy on Heroku

See: wabarc/on-heroku

TODO

Archive.org and Archive.today are currently supported, the next step mind support the followings platform:

Telegram bot

License

Permissive GPL 3.0 license, see the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker added in v0.1.0

type Broker interface {
	IA() goal
	IS() goal
	WBIPFS() goal
}

type Config

type Config struct {
	Token  string
	ChatID string
	Debug  bool
	IPFS   *IPFSRV
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(token string, debug bool, chatid string, h map[string]bool, ipfs *IPFSRV) *Config

func (*Config) Telegram

func (cfg *Config) Telegram()

type Handle added in v0.1.0

type Handle struct {
	URI  []string
	IPFS *IPFSRV
	// contains filtered or unexported fields
}

func (*Handle) IA added in v0.1.0

func (h *Handle) IA() goal

func (*Handle) IS added in v0.1.0

func (h *Handle) IS() goal

func (*Handle) WBIPFS added in v0.1.0

func (h *Handle) WBIPFS() goal

type IPFSRV added in v0.1.0

type IPFSRV struct {
	Host   string
	Port   uint
	Mode   string
	UseTor bool
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL