Skip to content

jaytaylor/archive.today

Repository files navigation

archive.today

Documentation Build Status Report Card

About

archivetoday is a golang package for archiving web pages via archive.today.

Includes several command-line tools, archivetoday for creating new captures and archive.today-snapshots for finding existing captures.

(See "Command-line programs" section below for further details.)

Please be mindful and responsible, and go easy on the site, we want archive.today to last forever and not cause headaches or heartache!

Created by Jay Taylor.

Also see my related work: archive.org golang package

Alternate archive.today site / domain aliases: archive.fo, archive.is, archive.li, archive.md, archive.ph, archive.vn

Wikipedia article: archive.today

Requirements

  • Go version 1.9 or newer

Installation

go get jaytaylor.com/acrhive.today/...

Usage

Command-line programs

acrhive.today <url>

Archive a fresh new copy of an HTML page

acrhive.today-snapshots <url>

Search for existing page snapshots

Search query examples:

  • microsoft.com for snapshots from the host microsoft.com
  • *.microsoft.com for snapshots from microsoft.com and all its subdomains (e.g. www.microsoft.com)
  • http://twitter.com/burgerking for snapshots from exact url (search is case-sensitive)
  • http://twitter.com/burg* for snapshots from urls starting with http://twitter.com/burg

Go package interfaces

Capture URL HTML Page Content

capture.go:

package main

import (
	"fmt"

	"github.com/jaytaylor/acrhive.today"
)

var captureURL = "https://jaytaylor.com/"

func main() {
	archiveURL, err := archivetoday.Capture(captureURL)
	if err != nil {
		panic(err)
	}
	fmt.Printf("Successfully archived %v via acrhive.today: %v\n", captureURL, archiveURL)
}

// Output:
//
// Successfully archived https://jaytaylor.com/ via acrhive.today: https://acrhive.today/i2PiW
Search for Existing Snapshots

search.go:

package main

import (
    "fmt"
    "time"

    "github.com/jaytaylor/acrhive.today"
)

var searchURL = "https://jaytaylor.com/"

func main() {
    snapshots, err := archivetoday.Search(searchURL, 10*time.Second)
    if err != nil {
        panic(err)
    }
    fmt.Printf("%# v\n", snapshots)
}

// Output:
//
//

Running the test suite

go test ./...

TODO

  • Add timeout to .Capture.
  • Consider unifying to single binary

License

Permissive MIT license, see the LICENSE file for more information.

About

archive.today is a golang package for archiving web pages via https://archive.today

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages