json

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package json Wayback Availability JSON API. https://archive.org/help/wayback_api.php

Index

Constants

View Source
const BaseURL = "http://archive.org/wayback/"

BaseURL base URL of the API endpoint.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	URL               string   `json:"url"`
	ArchivedSnapshots Snapshot `json:"archived_snapshots"`
	Timestamp         string   `json:"timestamp"`
}

APIResponse the API response.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an API JSON client.

func New

func New() *Client

New creates a new Client.

func (Client) Available

func (c Client) Available(ctx context.Context, host, timestamp string) (*APIResponse, error)

Available test to see if a given url is archived and currently accessible in the Wayback Machine.

type Item

type Item struct {
	Status    string `json:"status"`
	Available bool   `json:"available"`
	URL       string `json:"url"`
	Timestamp string `json:"timestamp"`
}

Item information.

type Snapshot

type Snapshot struct {
	Closest Item `json:"closest"`
}

Snapshot snapshot information.

Jump to

Keyboard shortcuts

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