[mastodon]いいねブーストした人を可視化

    @@ -2,6 +2,7 @@ // @description トゥートの個別ページでいいね・ブーストした人のアイコンを表示します。 // @include https://*/users/*/updates/* // @include https://*/@*/* +// @downloadURL http://let.hatelabo.jp/pacochi/let/hJme_JyaqvZC.user.js // @license MIT License // @javascript_url @@ -18,9 +19,15 @@ l.forEach((n, i) => { - if (n.textContent > 0) - fetch(u[1] + 'api/v1/statuses' + u[2] + ['/reblogged_by', '/favourited_by'][i]) - .then(r => r.json()).then(j => (j.forEach ? j : []).forEach(a => { + if (n.textContent > 0) fetch( + /* + https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#statuses + max_id 指定すると何も出てこなくなる、since_id 指定しても何も変わらない、そのうち調べる + */ + u[1] + 'api/v1/statuses' + u[2] + + ['/reblogged_by', '/favourited_by'][i] + + (n.textContent > 40 ? '?limit=80' : '') + ).then(r => r.json()).then(j => (j.forEach ? j : []).forEach(a => { n.appendChild(Object.assign(d.createElement('a'), { href: a.url, title: a.display_name @@ -29,7 +36,7 @@ src: a.avatar, style: 'width: 20px; height: 20px; margin: 0 2px;' })); - })); + })); });
  • // @title [mastodon]いいねブーストした人を可視化
    // @description トゥートの個別ページでいいね・ブーストした人のアイコンを表示します。
    // @include https://*/users/*/updates/*
    // @include https://*/@*/*
    // @downloadURL http://let.hatelabo.jp/pacochi/let/hJme_JyaqvZC.user.js
    // @license MIT License
    // @javascript_url
    
    /*
    friends.nico は "アクセストークンが無効です。" ってエラー返ってくるからまた今度
    */
    
    ((d = document, l, u) => {
    
    	l = [...d.querySelectorAll('a.detailed-status__datetime, .detailed-status__meta>span')];
    	if (l.length != 3) return;
    	u = l.shift().href.match(/^(.+?\/)@.+?(\/\d+)/);
    	if (!u) return;
    
    	l.forEach((n, i) => {
    
    		if (n.textContent > 0) fetch(
    		/*
    		https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#statuses
    		max_id 指定すると何も出てこなくなる、since_id 指定しても何も変わらない、そのうち調べる
    		*/
    		 u[1] + 'api/v1/statuses' + u[2]
    		 + ['/reblogged_by', '/favourited_by'][i]
    		 + (n.textContent > 40 ? '?limit=80' : '')
    		).then(r => r.json()).then(j => (j.forEach ? j : []).forEach(a => {
    
    			n.appendChild(Object.assign(d.createElement('a'), {
    			 href: a.url, title: a.display_name
    			}))
    			.appendChild(Object.assign(d.createElement('img'), {
    			 src: a.avatar, style: 'width: 20px; height: 20px; margin: 0 2px;'
    			}));
    
    		}));
    
    	});
    
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2018/03/31 00:02:16 - 2018-03-31
  2. 2017/09/10 16:41:00 - 2017-09-10
  3. 2017/05/07 23:02:42 - 2017-05-07
  4. 2017/05/07 17:04:04 - 2017-05-07
  5. 2017/05/07 17:01:58 - 2017-05-07
  6. 2017/05/07 16:15:23 - 2017-05-07