Skip to content

Instantly share code, notes, and snippets.

@detj
Created November 21, 2013 13:31
Show Gist options
  • Save detj/7581618 to your computer and use it in GitHub Desktop.
Save detj/7581618 to your computer and use it in GitHub Desktop.
Parse youtube urls
var foo = document.querySelectorAll('a');
foo.map(function(i, v) {
var m = v.getAttribute('href');
var c = m && m.match(/(?:watch\?v=([-_a-zA-Z0-9]+))/);
return c && c[1];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment