あなたが Ruby on Rails を使わない 10 の理由を、マーク副社長が分かりやすく解説します。 - にぽたん研究所

March 16, 2007

このエントリーをはてなブックマークに追加
なんで?Rails 使わないよ

という Greasemonkey script を思いついたので公開してみます。

元ネタ:
YappoLogs: あなたがRuby on Railsを使わない10の理由
株式会社MARC-2 アンデスAZジュース

以下の GM script をインスコして、YappoLogs の元ネタエントリを見てみてください。

answeredbymarc.user.js

実行結果:
マーク副社長


// ==UserScript==
// @name           Answered by Marc
// @namespace      http://blog.livedoor.jp/nipotan/
// @description    Marc V.P. answers your Question
// @include        http://blog.yappo.jp/yappo/archives/000499.html
// ==/UserScript==
(function () {
    var questions = document.getElementsByTagName('H2');
    for (var iYappo = 0; iYappo < questions.length; iYappo++) {
        if (questions[iYappo].className == "date")
            continue;
        var questionerImageSrc = [
            'http://www.marc-2.com/images/qa_new/q0',
            Math.floor(Math.random() * 9) + 1,
            '.gif',
        ].join('');
        var marcImageSrc = [
            'http://www.marc-2.com/images/qa_new/answer',
            Math.floor(Math.random() * 3) + 1,
            '.gif'
        ].join('');

        var questionerImage = document.createElement('IMG');
	questionerImage.src = questionerImageSrc;
        var marcImage = document.createElement('IMG');
        marcImage.src = marcImageSrc;
        questions[iYappo].insertBefore(questionerImage, questions[iYappo].firstChild);
        var marcNode = questions[iYappo];
        while (1) {
            marcNode = marcNode.nextSibling;
            if (marcNode.tagName == "P") {
                break;
            }
        }
        marcNode.insertBefore(marcImage, marcNode.firstChild);
    }
})();



nipotan at 13:03 | Comments(0) | 雑記 
このエントリーをはてなブックマークに追加

Post a comment

Name:
URL:
  Remember info?: Rate: Face    Star