ga

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 9 Imported by: 0

README

A Golang and Command-Line Interface to Ghostarchive

This package is a command-line tool named ghostarchive saving webpage to Ghostarchive, it also supports imports as a Golang package for a programmatic. Please report all bugs and issues on Github.

Installation

From source:

go get github.com/wabarc/ghostarchive

From gobinaries.com:

curl -sf https://gobinaries.com/wabarc/ghostarchive/cmd/ghostarchive | sh

From releases

Usage

Command-line
$ ghostarchive https://example.com

Output:
version: 0.0.1
date: unknown

https://example.com => https://ghostarchive.org/archive/eb4i3
Go package interfaces
package main

package ga

import (
        "fmt"

        "github.com/wabarc/ghostarchive"
)

func main() {
        wbrc := &ga.Archiver{}
        saved, _ := wbrc.Wayback(args)
        for orig, dest := range saved {
                fmt.Println(orig, "=>", dest)
        }
}

// Output:
// https://example.com => https://ghostarchive.org/archive/eb4i3

License

This software is released under the terms of the MIT. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Functions

This section is empty.

Types

type Archiver

type Archiver struct {
	Client *http.Client
}

func (*Archiver) Playback

func (wbrc *Archiver) Playback(ctx context.Context, u *url.URL) (result string, err error)

Playback handle searching archived webpages from archive.is

func (*Archiver) Wayback

func (wbrc *Archiver) Wayback(ctx context.Context, u *url.URL) (result string, err error)

Wayback is the handle of saving webpages to archive.org

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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