Twimgs@

    @@ -1,18 +1,30 @@ /* - * @title canonical - * @description log canonical url - * @include http://* - * @include https://* - * @contributor noromanba + * @title Twimgs@ + * @description view twitter.com-@user all images w/ timg.azurewebsites.net + * @include *://twitter.com/* + * @include *://mobile.twitter.com/* * @license MIT License http://opensource.org/licenses/MIT * @javascript_url */ -// https://gist.github.com/noromanba/d730ccf3ae5e6916cd60 +// support RT e.g. +// https://twitter.com/twitter + +// TBD +// - append link to all Twitter links/cards on whole sites +// - append link to all tweets +(() => { + // https://gist.github.com/noromanba/d730ccf3ae5e6916cd60 + const canon = (() => { + return (document.head.querySelector('meta[property="og:url"][content]') || {}).content || + (document.head.querySelector('link[rel="canonical"][href]') || {}).href || + location.href; + })(); + + const screenName = new URL(canon).pathname.split('/').slice(1)[0]; + if (!screenName) return; + + const SERVICE = 'https://timg.azurewebsites.net/'; + location.href = SERVICE + screenName; +})(); -(function () { - var url = (document.head.querySelector('meta[property="og:url"][content]') || {}).content || - (document.head.querySelector('link[rel="canonical"][href]') || {}).href || - location.href; - if (console && console.log) console.log(url); -})();
  • /*
     * @title Twimgs@
     * @description view twitter.com-@user all images w/ timg.azurewebsites.net
     * @include *://twitter.com/*
     * @include *://mobile.twitter.com/*
     * @license MIT License http://opensource.org/licenses/MIT
     * @javascript_url
     */
    
    // support RT e.g.
    // https://twitter.com/twitter
    
    // TBD
    // - append link to all Twitter links/cards on whole sites
    // - append link to all tweets
    (() => {
        // https://gist.github.com/noromanba/d730ccf3ae5e6916cd60
        const canon = (() => {
            return (document.head.querySelector('meta[property="og:url"][content]') || {}).content ||
                (document.head.querySelector('link[rel="canonical"][href]') || {}).href ||
                location.href;
        })();
    
        const screenName = new URL(canon).pathname.split('/').slice(1)[0];
        if (!screenName) return;
    
        const SERVICE = 'https://timg.azurewebsites.net/';
        location.href = SERVICE + screenName;
    })();
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2016/01/18 02:35:01 - 2016-01-18
  2. 2016/01/17 04:36:33 - 2016-01-17
  3. 2016/01/17 04:34:42 - 2016-01-17