<commit_before>/* MediaType
================================================== */
if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
	
	//VMM.mediaType.youtube(d); //should return a true or false
	// VMM.MediaType(url); //returns an object with .type and .id
	
	VMM.MediaType = function(d) {
		var success	= false,
			media	= {
				type:		"unknown",
				id:			"",
				link:		"",
				lang:		"",
				uniqueid:	VMM.Util.unique_ID(6)
			};
		
		if (d.match("div class='twitter'")) {
			media.type = "twitter-ready";
		    media.id = d;
		    success = true;
		} else if (d.match('(www.)?youtube|youtu\.be')) {
			if (d.match('v=')) {
				media.id = VMM.Util.getUrlVars(d)["v"];
			} else if (d.match('\/embed\/')) {
				media.id = d.split("embed\/")[1].split(/[?&]/)[0];
			} else {
				media.id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];
			}
		    media.type = "youtube";
		    success = true;
		} else if (d.match('(player.)?vimeo\.com')) {
		    media.type = "vimeo";
		    media.id = d.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];;
		    success = true;<commit_msg>Documentation<commit_after>/*	MediaType
	Determines the type of media the url string is.
	returns an object with .type and .id
	the id is a key piece of information needed to make
	the request of the api.
================================================== */
if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
	
	VMM.MediaType = function(d) {
		var success	= false,
			media	= {
				type:		"unknown",
				id:			"",
				link:		"",
				lang:		"",
				uniqueid:	VMM.Util.unique_ID(6)
			};
		
		if (d.match("div class='twitter'")) {
			media.type = "twitter-ready";
		    media.id = d;
		    success = true;
		} else if (d.match('(www.)?youtube|youtu\.be')) {
			if (d.match('v=')) {
				media.id = VMM.Util.getUrlVars(d)["v"];
			} else if (d.match('\/embed\/')) {
				media.id = d.split("embed\/")[1].split(/[?&]/)[0];
			} else {
				media.id = d.split(/v\/|v=|youtu\.be\//)[1].split(/[?&]/)[0];
			}
		    media.type = "youtube";
		    success = true;
		} else if (d.match('(player.)?vimeo\.com')) {
		    media.type = "vimeo";
		    media.id = d.split(/video\/|\/\/vimeo\.com\//)[1].split(/[?&]/)[0];;
		    success = true;
{'fraction_non_alphanumeric': 0.2696579298089738, 'fraction_numerical': 0.006219458018658374, 'mean_word_length': 2.620578778135048, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6179690', 'n_tokens_mistral': 990, 'n_tokens_neox': 855, 'n_words': 162}