Coursera ERT

    @@ -16,9 +16,11 @@ return +(node.textContent.match(/(\d+)\s+min/) || [])[1] || 0; }).reduce((a, b) => a + b, 0) || '-') + ' min'); -// transpiled/minified for mobile; w/ +// transpiled/minified for newest mobile; w/ // https://babeljs.io/repl/ // https://chriszarate.github.io/bookmarkleter/ +// TODO polyfill e.g. babel-polyfill +// https://babeljs.io/docs/usage/polyfill/ /* javascript:alert(%22total%20%22+(Array.from(document.querySelectorAll(%22.text-hint%22),function(t){return+(t.textContent.match(/(\d+)\s+min/)||[])[1]||0}).reduce(function(t,e){return%20t+e},0)||%22-%22)+%22%20min%22); */
  • /*
     * @title Coursera ERT
     * @description show Estimated Reading Time on Coursera
     * @include https://www.coursera.org/learn/machine-learning/home/week/*
     * @contributor hitode909 http://let.hatelabo.jp/hitode909/let/hJmc5Jbys6YJ (Fork of)
     * @license MIT License http://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    // - avoid mixed-content blocking w/ @javascript_url; c.f.
    //    http://let.hatelabo.jp/help#at-javascript_url
    //    https://gist.github.com/noromanba/7015739
    // - avoid ref-error when reduce
    
    alert('total ' + (Array.from(document.querySelectorAll('.text-hint'), node => {
        return +(node.textContent.match(/(\d+)\s+min/) || [])[1] || 0;
    }).reduce((a, b) => a + b, 0) || '-') + ' min');
    
    // transpiled/minified for newest mobile; w/
    //  https://babeljs.io/repl/
    //  https://chriszarate.github.io/bookmarkleter/
    // TODO polyfill e.g. babel-polyfill
    //  https://babeljs.io/docs/usage/polyfill/
    /*
    javascript:alert(%22total%20%22+(Array.from(document.querySelectorAll(%22.text-hint%22),function(t){return+(t.textContent.match(/(\d+)\s+min/)||[])[1]||0}).reduce(function(t,e){return%20t+e},0)||%22-%22)+%22%20min%22);
    */
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2016/02/28 23:52:39 - 2016-02-28
  2. 2016/02/28 05:31:28 - 2016-02-28
  3. 2016/02/28 04:43:07 - 2016-02-28
  4. 2016/02/28 03:48:07 - 2016-02-28
  5. 2016/02/28 03:45:36 - 2016-02-28
  6. 2016/02/28 03:44:47 - 2016-02-28