Skip to content

Instantly share code, notes, and snippets.

@remy
Created August 29, 2016 08:04
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save remy/8a7aa53bb0a8102bb6ff9775e3c1289d to your computer and use it in GitHub Desktop.
Save remy/8a7aa53bb0a8102bb6ff9775e3c1289d to your computer and use it in GitHub Desktop.
Obviously change remysharp.com for the domain you want to check.
curl http://web.archive.org/cdx/search/cdx\?limit\=1\&url\=remysharp.com | awk '{ print $2 }' | xargs date -j -f "%Y%m%d%H%M%S"
@sebilasse
Copy link

or if anybody needs it in node.js :

var checkMyAge = 'remysharp.com';
var http = require('http');
http.get({
  hostname: 'web.archive.org',
  port: 80,
  path: '/cdx/search/cdx?limit=1&url='+checkMyAge,
  agent: false
}, (res) => {
  res.setEncoding('utf8');
  res.on('data', function (chunk) {
    var D = new Date(chunk.split(' ')[1].replace(
      /^(.{4})(.{2})(.{2})(.{2})(.{2})(.{2})/g, '$1-$2-$3T$4:$5:$6'
    ));
    console.log( 'First seen: ', D );
  });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment