→ Subscribe

  • /*
     * @title → Subscribe 
     * @description Google Reader '→ Subscribe ' Fix ver. based on http://googlereader.blogspot.com/2005/11/subscribing-to-feeds-via-little-google.html
     * @include http://*
     * @license MIT License
     * @require 
     */
    
    var f = false;
    var ls = document.getElementsByTagName('link');
    for(var i = 0,l; l = ls[i]; i++) {
    	var t = l.getAttribute('type');
    	var r = l.getAttribute('rel');
    	if(t && (t == 'application/rss+xml' || t == 'application/atom+xml') && r && r == 'alternate') {
    		var h = l.getAttribute('href');
    		if(h.indexOf('http') != 0) {
    			var p = (h.indexOf('/') != 0) ? '/' : location.pathname;
    			h = 'http://' + location.hostname + p + h;
    		}
    	//location=' http://google.com/reader/preview/*/feed/' + h;
    	location=' http://google.com/reader/view/feed/' + h;
    	f = true;
    	break;
    	}
    }
    
    if(!f) alert('Oops. Can\'t find a feed.');
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2011/06/27 04:07:00 - 2011-06-27