近辺のツイート表示

  • /*
     * @title 近辺のツイート表示
     * @description Twitterの個別ツイート(https://twitter.com/<name>/status/<id>)前後のタイムラインを表示→【ユーザースクリプトあります】http://d.hatena.ne.jp/furyu-tei/20140327/1395914958
     * @include https://twitter.com/*
     * @license MIT License
     * @javascript_url
     */
    
    // 近傍ツイート検索ブックマークレット(フル機能版)はこちら→ http://let.hatelabo.jp/furyu-tei/let/hLHV0tfq3cZU
    
    (function (i, u, s, c, q, w) {
        w = window.open('https://twitter.com/search?q=' + encodeURIComponent('from:' + u + ' since:' + c(s - 3600 * 24) + ' until:' + c(s + 3600 * 48)) + '&f=realtime');
        s = 3;
        c = function ($) {
            $ = (function () {
                try {
                    return w.$
                } catch (e) {
                    return 0
                }
            })();
            if (!$ || !(q = $("li[data-item-id='" + i + "']"))[0]) {
                if ($) $('body,html').animate({
                    scrollTop: $('li[data-item-id]:last').offset().top
                }, '0');
                if (!$ || !($('div.stream-end').is(':visible') && !(s--))) setTimeout(c, 300)
            } else {
                q.css('background', 'gold');
                $('body,html').animate({
                    scrollTop: q.offset().top - $(w).height() / 2
                }, '0')
            }
        };
        c()
    })($('div.permalink-tweet').attr('data-item-id'), $('div.permalink-tweet').attr('data-screen-name'), parseInt($('div.permalink-tweet span[data-time]').attr('data-time')), function (s, d) {
        d = new Date(1000 * s);
        return d.getUTCFullYear() + '-' + (1 + d.getUTCMonth()) + '-' + d.getUTCDate()
    });
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2018/04/20 16:31:56 - 2018-04-20
  2. 2014/06/13 23:05:00 - 2014-06-13
  3. 2014/03/29 10:23:37 - 2014-03-29
  4. 2014/03/21 21:53:19 - 2014-03-21
  5. 2014/03/21 21:40:29 - 2014-03-21
  6. 2014/03/21 19:56:17 - 2014-03-21
  7. 2014/03/21 19:11:43 - 2014-03-21
  8. 2014/03/21 19:08:43 - 2014-03-21
  9. 2014/03/21 19:05:37 - 2014-03-21
  10. 2014/03/21 19:05:21 - 2014-03-21
  11. 2014/03/21 19:02:40 - 2014-03-21