Skip to content

Instantly share code, notes, and snippets.

@ComFreek
Last active December 10, 2015 16:38
Show Gist options
  • Save ComFreek/4461805 to your computer and use it in GitHub Desktop.
Save ComFreek/4461805 to your computer and use it in GitHub Desktop.
Extract all ISO 639-1 language codes from the Wikipedia article's table: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes.
// Wikipedia article: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
// jQuery Bookmarklet: http://marklets.com/jQuerify.aspx
// Extract language names
var str = ""; $("table td:nth-child(3)").each(function (idx, val) {str += $(val).text() + "\n";}); $("#bodyContent").prepend($("<textarea></textarea>").val(str));
// Extract language codes (2 characters)
var str = ""; $("table td:nth-child(5)").each(function (idx, val) {str += $(val).text() + "\n";}); $("#bodyContent").prepend($("<textarea></textarea>").val(str));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment