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 です。