[userscript] remove ‘ㅋ’ in facebok and twitter

For facebook:

// ==UserScript==
// @name remove ㅋ
// @namespace Kjwon15
// @description remove ㅋ in any page
// @include http://*.facebook.com/*
// @include https://*.facebook.com/*
// ==/UserScript==

removeFunc = function(){
	var divs = document.querySelectorAll('div.storyContent');
	var count = 0;
	for(var i=0; i<divs.length; i++){
		count += (divs[i].innerHTML.match(/ㅋ/g)||[]).length;
		divs[i].innerHTML = divs[i].innerHTML.replace(/ㅋ/g, '');
	}
	if(count > 0){
		alert('removed ' + count + ' ㅋs');
		beeper(count);
	}
}

window.addEventListener('load', removeFunc, false);

//var button = document.createElement('button');
//button.innerHTML = 'click';
//button.style.cssText = "position: fixed; top: 0; left: 0; z-index: 9999; background-color: #808080;";
//button.onclick = removeFunc;
//document.body.appendChild(button);

For twitter

// ==UserScript==
// @name remove ㅋ at twitter
// @namespace Kjwon15
// @description remove ㅋ in twitter
// @include http://twitter.com/*
// @include https://twitter.com/*
// ==/UserScript==

removeFunc = function(){
	var count = 0;
	var tweets = document.querySelectorAll("p.js-tweet-text");
	for(var i=0; i<tweets.length; i++){
		count += (tweets[i].innerHTML.match(/ㅋ/g)||[]).length;
		tweets[i].innerHTML = tweets[i].innerHTML.replace(/ㅋ/g, '');
	};
	if(count > 0){
		alert('removed ' + count + ' ㅋs');
	}
	return false;
}

window.addEventListener('load', removeFunc, false);

var li = document.createElement('li');
var button = document.createElement('a');
button.id = 'kuchen';
button.href = "/";
button.innerHTML = '<span>remove</span>';
button.className = "js-nav";
//button.style.cssText = "display: block; height: 12px; color: #00a7e1; padding: 13px 12px 15px; font-weight: bold; line-height: 1;";
button.onclick = removeFunc;
li.appendChild(button);
document.querySelector('ul#global-actions').appendChild(li);

kjwon15

I'm a hacker, I want to improve life.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.