Wayback Machine Bookmarklet

Have you ever returned to a web page you hadn't visited in a while only to discover it no longer exists, or has changed beyond all recognition? If so, one way to banish those dreaded “404 Not Found Blues” is to try your luck with the excellent Internet Archive's Wayback Machine.

The Wayback Machine

Think of the Wayback Machine as a cross between a search engine and a time machine. Type in a URL and it will return a chronological list of all the “snapshots” it has taken of that page since as far back as 1996. Click on the archived web page you want and it will load in your browser looking exactly as it did the day the Wayback Machine “crawled” it.

Even more amazing is that not only is the HTML of the web page archived, but also the graphics, audio, style sheets, scripts and downloads linked to that page. I've often used the Wayback Machine to retrieve old software titles.

Unfortunately, an obtrusive yellow banner containing links to the previous and next “captures”, etc. is added to the top of every archived page. But at least there's a link to close it. The Wayback Machine's most serious shortcoming is, however, the lack of a keyword search. It has been “coming soon” for as long as I can remember.

The Bookmarklet

One thing that would make this indispensable service even better is the provision of a bookmarklet (also referred to as “favelets” by some individuals). There are many available on the web, but the version presented here has been updated to work with most modern browsers. To install, simply drag the link below to your toolbar, or right-click on it and add it to your bookmarks.

Go Wayback

The next time you go to a page that no longer exists, or if you're just curious to see what a page used to look like years ago, click on the bookmarklet and a new window will open listing all the archived versions of the current page (if any).

Code Explained

Below is the source for the bookmarklet formatted for easier reading.

<a href="javascript:
    void(
        open('http://web.archive.org/web/*/'+
            encodeURI(location.href.replace(/res:[^#]*#/,''))
        ,'Wayback')
    )
">Go Wayback</a>

Basically, it's a JavaScript snippet wrapped inside a HTML anchor tag. The JavaScript that does all the work is further wrapped inside the void() function because we're interested in the effect of executing the snippet and not the result.

The URL passed to the Wayback Machine is prepared in stages. First, any res: protocol URIs sometimes generated by Internet Explorer are removed by the replace() function, then the encodeURI() function converts any troublesome characters to their URI-encoded equivalents (eg, space becomes %20).

Once the URL has been put together, the open() function opens a new window containing the search results page from the Wayback Machine for the URL of the current page.

And that's more or less it. I hope the bookmarklet helps to make surfing the past a smoother experience for you. As always, feel free to leave a comment.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s