通知の行かない なんちゃって引用ツイート

  • /*
     * @title 通知の行かない なんちゃって引用ツイート
     * @description Twitterで引用ツイートを嫌がる方のツイートを引用したい場合に使ってみる?
     * @include https://twitter.com/*
     * @include https://mobile.twitter.com/*
     * @license MIT License
     * @require 
     * @javascript_url
     */
    
    ( () => {
    const
        width = 1024,
        height = 768;
    
    let matches = new URL( location.href ).pathname.match( /^\/([^/]+)\/status\/(\d+)/ );
    if ( ! matches ) return;
    
    let screen_name = matches[ 1 ],
        id_str = matches[ 2 ],
        id = BigInt( id_str ),
        query = 'from:' + screen_name + ' since_id:' + (id - 1n ) + ' max_id:' + id,
        url = 'https://twitter.com/search?f=live&q=' + encodeURIComponent( query );
    
    window.open( 'https://twitter.com/intent/tweet?url=' + encodeURIComponent( url ),
        '_blank',
        [
            'width=' + width,
            'height=' + height,
            'left=' + ( window.innerWidth - width ) / 2,
            'top=' + ( window.innerHeight - height ) / 2,
            'scrollbars=yes',
            'resizable=yes',
            'toolbar=no',
            'location=yes',
        ].join( ',' )
    );
    } )();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2020/09/12 19:44:35 - 2020-09-12
  2. 2020/09/12 19:42:45 - 2020-09-12