YAPC> _

    @@ -1,5 +1,5 @@ /* - * @title YAPC:_ + * @title YAPC> _ * @description Yet Another Poem Comment * @include http://doraperson2015.yapcasia.org/* * @license MIT License http://opensource.org/licenses/MIT
  • /*
     * @title YAPC> _
     * @description Yet Another Poem Comment
     * @include http://doraperson2015.yapcasia.org/*
     * @license MIT License http://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    (function () {
        // $x('/html/head/comment()[2]')
        var poem = document.createNodeIterator(document.head, NodeFilter.SHOW_COMMENT, {
            acceptNode: function (node) {
                // reject Conditional Comment (aka Version Vector)
                return /^[[:punct:]|[:alphnum:]]+$/.test(node.data) ?
                    NodeFilter.FILTER_REJECT :
                    NodeFilter.FILTER_ACCEPT;
            }
        }).nextNode().textContent;
    
        window.alert([
            document.lastModified.split(' ').pop(),
            'yapcasia:',
            poem
        ].join(' '));
    })();
    
    // c.f.
    // https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator
    // https://developer.mozilla.org/en-US/docs/Web/API/NodeFilter
    // https://developer.mozilla.org/en-US/docs/Web/API/NodeFilter/acceptNode
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2015/06/10 09:38:37 - 2015-06-10
  2. 2015/06/10 09:11:29 - 2015-06-10
  3. 2015/06/10 09:01:55 - 2015-06-10