YouTube Auto-Like Videos

By JoeSimmons Last update Nov 17, 2011 — Installed 748 times.

There are 5 previous versions of this script.

// ==UserScript==
// @name           YouTube Auto-Like Videos
// @namespace      http://userscripts.org/users/23652
// @description    Automatically clicks the "Like" button
// @include        http*://*.youtube.com/watch*v=*
// @include        http*://youtube.com/watch*v=*
// @copyright      JoeSimmons
// @version        1.0.23
// @license        http://creativecommons.org/licenses/by-nc-nd/3.0/us/
// @require        http://sizzlemctwizzle.com/updater.php?id=58010
// ==/UserScript==



/////////       THE LIST OF USERS TO AUTO-LIKE VIDEOS FROM GOES BELOW       //////////////////////////
/////////       SEPARATED BY LINES. START AFTER THE CDATA LINE AND END      //////////////////////////
/////////       BEFORE THE toString LINE                                    //////////////////////////
var passlist = <><![CDATA[
onlyusemeblade
schehf
psnjj9394
]]></>.toString();

/////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////// END USER ENTRY ///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////


var pass = new RegExp("(" + passlist.trim().replace(/ /g,"").split("\n").join("|") + ")", "gi");

if(pass.test(document.evaluate("//*[@id='watch-uploader-info']//a[contains(@class, 'author')]", document, null, 9, null).singleNodeValue.textContent)) {

	// delay the click to 1 second after DOM load
	window.setTimeout(function() {

		// find it
		var like = document.getElementById("watch-like");

		// click it
		if(like) like.click();

	}, 3000);

}