Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const Name = 'wayback', Wayback = '',
Base = '<style>'+ <![CDATA[
li {display:inline-block; font-family:monospace; margin-right:2.5em}
button {
padding:0; margin-right:0.3em; border-width:1px;
font:bold 104% monospace}
.error {font-style:oblique; line-height:1.8}
.logo {clear:both; display:inline-block}
.logo > img {vertical-align:middle}
.loading {opacity:0.9}
.loading + .logo {opacity:0.4}
.error + .logo {opacity:0.7}
]]> +'</style>'+ <div class={Name}><div id={Name}
> </div><a class="logo" href={Wayback}
><img border="0" src={Wayback +'images/wayback_logo_sm.gif'}/></a></div>;
function hmm(c){
c.textContent = Array.slice(arguments, 1).join(' ');
c.className = 'error';
function req(url) Wayback +'web/*/'+ (url || here());
function here() CmdUtils.getWindow().location;
function open(i, e){
name: 'wayback',
icon: Wayback +'favicon.ico',
argument: noun_type_url,
description: 'Wayback Machine'.link(Wayback),
execute: function wb_execute({object: {text}}){
preview: function wb_preview(pb, {object: {text}}){
var cn;
while(!(cn = pb.ownerDocument.getElementById(Name))) pb.innerHTML = Base;
cn.className += ' loading';
CmdUtils.previewAjax(pb, {
url: req(text),
success: function wb_success(htm){
var ls = htm.match(
/<a href=.http:\/\/web\.archive\.org\/web\/\d+.+?\/a>/g);
if(!ls) return hmm(c, 'No matches.');
CmdUtils.previewList(cn, ls.reverse(), open);
cn.className = '';
error: function wb_error(x, s){ hmm(cn, x.status, x.statusText) },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.