とみふらの明るく楽しい日記

日記や俺用メモなどなんでもあり。

俺のtwitterウェブページクライアント化がほぼ完了した。

今までぐりもんでスタイル変更してたけど、css使えばいいじゃん俺バカすぎる。・・・てことで作った。これで他のぐりもんとも色々組み合わせやすくなる。

div#container{
margin: 0 auto !important;
}

div.content-bubble-arrow{
margin-top: 0 !important;
padding-top: 0 !important;
}

fieldset.common-form{
margin: 0 0 !important;
}

h3{
margin: 0 0 0 !important;
}

h1#heading{
display: none !important;
}

div.section{
padding: 0 !important;
}

a#results_update{
margin: 0 0 !important;
}

a.minor-notification{
padding: 0 !important;
}

li.hentry{
padding: 0 !important;
}

span.entry-content{
font-size: 13px !important;
}

span.status-body{
margin-left: 30px !important;
min-height: 0 !important;
line-height: 13px !important;
font-size: 13px !important;
width: 500px !important;
}

span.entry-meta{
margin-top: 0px !important;
}

span.thumb{
height: 24px !important;
width: 24px !important;
}

img.fn{
height: 24px !important;
width: 24px !important;
}

p.promotion{
display: none !important;
}

めんどくさいので全部!importantしてみた。素人なのでそれでいいのかはよくわからないw


firefoxでユーザースタイルシート使うにはstylishというアドオンが便利です。
https://addons.mozilla.org/ja/firefox/addon/2108



インストールしたら↑(Tools→Add-ons)を開いて、Write New Styleを押して新しいスタイルを作る。



↑さっきのコードをコピペ。名前は自分の好きなもので。Saveを押す。これでおkなはず。


とりあえずこれで表示はおk。あとはぐりもんを入れて新着自動表示、サイドバーにリプライ表示、エンターで投稿できるようにした。

新着自動表示
http://d.hatena.ne.jp/nacookan/20091110/1257871123
Bookmarkletではなくぐりもんとして使ってる。


サイドバーにリプライ表示(Twitter Sidebar Replies)
http://userscripts.org/scripts/show/36635


Ctrl+Enterで投稿(twitposter)
http://sunone.blog1.fc2.com/blog-entry-418.html
http://d.hatena.ne.jp/mollifier/20100211/p1

ただし自分はCtrl+EnterではなくEnterで投稿したかったのと、このまま使うと投稿したときに今まで表示してたtweetsが消えてしまうので、以下のように修正して使ってます。

// ==UserScript==
// @name           twitposter
// @namespace      twitposter
// @description    keyboard shortcut for Twitter. 
// @include        http://twitter.com/*
// @include        https://twitter.com/*
// ==/UserScript==

var textArea = document.getElementById('status');
var handler = function(event){
    //if(event.ctrlKey == true && event.keyCode == 13) { //Ctrl+Enterでポスト
    if(event.keyCode == 13){ //Enterでポスト
        if(textArea.value == "") {
            return;
        }
        //document.getElementById('status_update_form').submit();
	var e = document.createEvent('MouseEvent');
	e.initMouseEvent(
	    'click', true, true, window,
	    0, 0, 0, 0, 0, false, false, false, false, 0, null
	);
	document.getElementById('update-submit').dispatchEvent(e);
    }
};

textArea.addEventListener('keydown', handler, false);

結果

これでもう過去のTL振り返ったりする必要ないならクライアントいらねです。