Skip to content

Instantly share code, notes, and snippets.

@sebilasse
Forked from remy/check.sh
Created August 29, 2016 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebilasse/71904760069332778103f6da5909247a to your computer and use it in GitHub Desktop.
Save sebilasse/71904760069332778103f6da5909247a 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
Author

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