Created
June 9, 2012 07:07
-
-
Save jnozsc/2899911 to your computer and use it in GitHub Desktop.
remove like item from douban timeline
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
// ==UserScript== | |
// @name NoLike for douban | |
// @namespace jnozsc | |
// @description Remove Like from douban timeline | |
// @include http://www.douban.com/* | |
// @match http://www.douban.com/* | |
// @version 1.2 | |
// ==/UserScript== | |
function main($) { | |
'use strict'; | |
jQuery.noConflict(); | |
// for old version | |
tlArray = $("#miniblog > ul").children(); | |
for(i = 0;i < tlArray.size()-1;i++){ | |
if((tlArray[i].className =='mbtr') && ((tlArray[i].innerHTML.indexOf("喜欢 ")!=-1) || (tlArray[i].innerHTML.indexOf("谈论 ")!=-1))){ | |
$(tlArray[i-1]).hide(); | |
$(tlArray[i]).hide(); | |
} | |
} | |
// for new version | |
$('div[data-target-type="ilmen"]').hide(); | |
} | |
function thirdParty($) { | |
'use strict'; | |
jQuery.noConflict(); | |
// Put third-party non-jQuery functions here. They'll be wrapped into the | |
// jQuery prototype in a moment. | |
var sayHello = function (who) { | |
alert('Hello ' + who + '!'); | |
} | |
jQuery.extend({ | |
// If you have any non-jQuery functions, they need to be wrapped in here. | |
sayHellow: function (who) { | |
return sayHello('World'); | |
} | |
}); | |
// Put third-party jQuery plugins, extensions, etc. here | |
} | |
! | |
function loader(i) { | |
var script, requires = ['http://img3.douban.com/js/packed_jquery.min6301986802.js'], | |
head = document.getElementsByTagName('head')[0], | |
makeScript = function () { | |
script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
}, | |
loadLocal = function (fn) { | |
makeScript(); | |
script.textContent = '(' + fn.toString() + ')(jQuery);'; | |
head.appendChild(script); | |
}; | |
(function (i) { | |
makeScript(); | |
script.src = requires[i]; | |
script.addEventListener('load', function () { | |
++i !== requires.length ? loader(i) : (loadLocal(thirdParty), loadLocal(main)); | |
}, true); | |
head.appendChild(script); | |
})(i || 0); | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment