H::Q profile csv

  • /*
     * @title H::Q profile csv
     * @description generate csv on Hatena Question profile page
     * @include http://q.hatena.ne.jp/*
     * @contributor mafucode	http://let.hatelabo.jp/mafucode/let/hLHXiJKUi9cB (Fork of)
     * @license MIT License	http://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    // - [x] fix zero-fill(padding) bug of month
    //  - fork of: "2015/21/29" (at 2015/03/29)
    // - [x] remove redundant last comma of csv
    // - [x] csv word-wrap
    
    // e.g. http://q.hatena.ne.jp/noromanba/
    (function () {
    	var table = document.querySelector('#usertable');
    	if (!table) return;
    
    	// c.f. https://gist.github.com/noromanba/6737784
    	//*
    	var date = new Date().toLocaleDateString('ja', {
    		year:	'numeric',
    		month:	'2-digit',
    		day:	'2-digit'
    	});
    	/*/
    	var now = new Date();
    	var date = [
    		now.getFullYear(),
    		('0' + (now.getMonth() + 1)).slice(-2),
    		('0' + now.getDate()).slice(-2)
    	].join('/');
    	//*/
    	var info = [date].concat(table.textContent.replace(/[^\d\n.-]/g, '').match(/[^\s]+/g));
    
    	var container = document.createElement('div');
    	container.style.wordWrap = 'break-word';
    	container.textContent = info;
    
    	table.parentNode.appendChild(container);
    })();
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2015/04/01 04:45:01 - 2015-04-01
  2. 2015/04/01 04:44:36 - 2015-04-01
  3. 2015/03/29 05:48:42 - 2015-03-29
  4. 2015/03/29 05:41:21 - 2015-03-29
  5. 2015/03/29 05:37:46 - 2015-03-29
  6. 2015/03/29 05:37:17 - 2015-03-29