Created
November 21, 2013 13:31
-
-
Save detj/7581618 to your computer and use it in GitHub Desktop.
Parse youtube urls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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