微博咆哮体[Chrome Extension]

传说最近咆哮体很火,昨晚下班就写了这个小玩意,在网页端发微博时,自动将微博内容转为咆哮体,

暂支持了腾讯,新浪,搜狐微博 

先看下截图:

 

主要代码如下:

(function(){
    
var $ = function(id){return document.getElementById(id)},
    sendBtn,txtMsg;
    
switch(location.hostname){
        
case "t.qq.com":
            sendBtn 
= document.getElementsByClassName("sendBtn")[0];
            txtMsg 
= $("msgTxt");
            
break;
        
case "t.sina.com.cn":
            sendBtn 
= $("publisher_submit");
            txtMsg 
= $("publish_editor");
            
break;
        
case "t.sohu.com":
            sendBtn 
= document.getElementsByClassName("crJs_submit")[0];
            txtMsg 
= document.getElementsByClassName("atfake");
            txtMsg 
= txtMsg.length > 0 && txtMsg.nextElementSibling;
            
break;
    }    
    
    
if(!(sendBtn || txtMsg)){return;}

    sendBtn.title 
= "咆哮吧!!!!!";
    sendBtn.addEventListener(
"mousedown"function(){
        
if(txtMsg.value.trim().length > 0) {
            txtMsg.value 
= paoxiao(txtMsg.value);
        }
    }, 
false);

})(); 

下载地址:t_paoxiao

 下载 后Chrome会自动提示安装,其它浏览器拖到Chrome中安装即可


If you could provide any suggestions or comments for this article, it is always welcome.

标签: 咆哮体, 微博
posted @ 2011-03-23 09:22 sohighthesky 阅读(2599) 评论(7) 编辑 收藏

 回复 引用 查看   
#1楼 2011-03-23 09:39 书痕      
感觉咆哮体还是要自己写更有意思,程序转换并不能与内容很好的融合
 回复 引用 查看   
#2楼[楼主] 2011-03-23 09:54 sohighthesky      
@书痕
仅供娱乐

 回复 引用 查看   
#3楼 2011-03-23 11:30 yyww      
现在流行少将体
 回复 引用 查看   
#4楼 2011-03-23 11:35 愚溪      
404. That’s an error.
The requested URL /files/t-paoxiao.crx was not found on this server. That’s all we know.

 回复 引用 查看   
#5楼[楼主] 2011-03-23 11:37 sohighthesky      
@愚溪
不好意思,地址已更新

 回复 引用 查看   
#6楼 2011-03-24 13:35 airwolf2026      
疼.哈哈
 回复 引用 查看   
#7楼 2011-03-25 10:02 Alice Tang      
原来那个就是咆哮体呀~