+Subscribe Twitter RSS

    @@ -1,13 +1,24 @@ /* * @title +Subscribe Twitter RSS - * @description Twitter RSS Subscribe to Google Reader (Forked) - * @see http://let.hatelabo.jp/m4i/let/gYC-yZKMjtONHg (Original-Let: Atom ver.) - * @see http://let.hatelabo.jp/noromanba/let/gYC-yZ-91I7yEg (Permalink) + * @description Twitter RSS Subscribe to Feed Reader (Forked) + * @contributor m4i http://let.hatelabo.jp/m4i/let/gYC-yZKMjtONHg (Fork of) * @include http://twitter.com/* * @include https://twitter.com/* - * @license MIT License http://noromanba.mit-license.org/2012+ + * @license MIT License http://nrm.mit-license.org/2012 */ -var reader = 'http://www.google.com/reader/view/feed/'; -var feed = encodeURIComponent('http://twitter.com/statuses/user_timeline/' + twttr.profileUser.id + '.rss'); -location.href = reader + feed; +(function () { + // TODO refactor: smart data-* handling + // http://www.w3.org/TR/html5/global-attributes.html#embedding-custom-non-visible-data-with-the-data-attributes + var id; + if (location.hostname !== 'twitter.com' || + !(id = document.querySelector('div[data-user-id]')) || + !(id = id.dataset.userId)) // or id.getAttribute('data-user-id') { + return; + } + + var reader = 'https://www.google.com/reader/view/feed/'; + // lifetime: 2013-03-05 + var feed = encodeURIComponent('https://api.twitter.com/1/statuses/user_timeline/' + id + '.rss'); + location.href = reader + feed; +})();
  • /*
     * @title +Subscribe Twitter RSS
     * @description Twitter RSS Subscribe to Feed Reader (Forked)
     * @contributor m4i http://let.hatelabo.jp/m4i/let/gYC-yZKMjtONHg (Fork of)
     * @include http://twitter.com/*
     * @include https://twitter.com/*
     * @license MIT License http://nrm.mit-license.org/2012
     */
    
    (function () {
        // TODO refactor: smart data-* handling
        // http://www.w3.org/TR/html5/global-attributes.html#embedding-custom-non-visible-data-with-the-data-attributes
        var id;
        if (location.hostname !== 'twitter.com' ||
            !(id = document.querySelector('div[data-user-id]')) ||
            !(id = id.dataset.userId)) // or id.getAttribute('data-user-id') {
            return;
        }
    
        var reader = 'https://www.google.com/reader/view/feed/';
        // lifetime: 2013-03-05
        var feed = encodeURIComponent('https://api.twitter.com/1/statuses/user_timeline/' + id + '.rss');
        location.href = reader + feed;
    })();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2012/10/20 06:00:57 - 2012-10-20
  2. 2012/10/20 05:54:36 - 2012-10-20
  3. 2012/10/20 05:42:48 - 2012-10-20
  4. 2012/10/20 04:17:52 - 2012-10-20
  5. 2012/10/20 04:13:03 - 2012-10-20
  6. 2012/10/20 03:01:27 - 2012-10-20
  7. 2012/10/20 02:59:26 - 2012-10-20
  8. 2012/01/31 03:06:34 - 2012-01-31
  9. 2012/01/31 02:50:03 - 2012-01-31
  10. 2012/01/27 05:37:34 - 2012-01-27
  11. 2012/01/21 02:16:24 - 2012-01-21
  12. 2012/01/21 02:04:37 - 2012-01-21
  13. 2012/01/21 01:23:50 - 2012-01-21
  14. 2012/01/21 01:02:08 - 2012-01-21