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
- Go version 1.9 or newer
go get jaytaylor.com/acrhive.today/...
Archive a fresh new copy of an HTML page
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
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
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:
//
//
go test ./...
- Add timeout to
.Capture
. - Consider unifying to single binary
Permissive MIT license, see the LICENSE file for more information.