Subscribe Gists
by
noromanba
2012-03-12 [2012/03/12 01:34:51]
Subscribe Public Gists (Atom).
@@ -1,29 +1,32 @@
/*
* @title Subscribe Gists
- * @description Subscribe Public Gists (Atom). Use 'Packed'. This script must be needs mixed scripting(load from insecure server by Hatena::Let).
+ * @description Subscribe Public Gists (Atom).
* @include https://gist.github.com/*
* @license MIT License http://noromanba.mit-license.org/2012+
* @see https://support.google.com/chrome/bin/answer.py?hl=ja&answer=1342714
* @require
*/
-// first jQuery experience(by guesswork)
+// [ATTENTION]
+// This bookmarklet must be running on mixed scripting environment
+// because callee server is use HTTP on 'http://hatelabo.jp'.
+// Open 'Packed'link -> add prefix 'javascript' before use.
+
+// first jQuery experience(by guesswork)
(function($){
var owner;
if (/^https:\/\/gist\.github\.com\/\d+/.test(location.href) && $('#owner .name a').length) {
owner = $('#owner .name a').text();
- console.info('::Let:: ' + '$ owner: ' + owner);
+ console.info('::Let:: ' + 'owner: ' + owner);
} else if (/^https:\/\/gist\.github\.com\/(\w+)/.test(location.href)) {
owner = RegExp.$1;
- console.info('::Let:: ' + '// owner: ' + owner);
+ console.info('::Let:: ' + 'owner: ' + owner);
}
if (owner) {
var feed = 'https://gist.github.com/' + owner + '.atom';
var reader = 'http://google.com/reader/view/feed/';
- console.info('::Let:: ' + 'reader: ' + reader + 'feed: ' + feed);
- //console.info('::Let:: ' + 'addr: ' + reader + encodeURIComponent(feed));
location.href = reader + encodeURIComponent(feed);
}
})(jQuery); void(0);
/*
* @title Subscribe Gists
* @description Subscribe Public Gists (Atom).
* @include https://gist.github.com/*
* @license MIT License http://noromanba.mit-license.org/2012+
* @see https://support.google.com/chrome/bin/answer.py?hl=ja&answer=1342714
* @require
*/
// [ATTENTION]
// This bookmarklet must be running on mixed scripting environment
// because callee server is use HTTP on 'http://hatelabo.jp'.
// Open 'Packed'link -> add prefix 'javascript' before use.
// first jQuery experience(by guesswork)
(function($){
var owner;
if (/^https:\/\/gist\.github\.com\/\d+/.test(location.href) && $('#owner .name a').length) {
owner = $('#owner .name a').text();
console.info('::Let:: ' + 'owner: ' + owner);
} else if (/^https:\/\/gist\.github\.com\/(\w+)/.test(location.href)) {
owner = RegExp.$1;
console.info('::Let:: ' + 'owner: ' + owner);
}
if (owner) {
var feed = 'https://gist.github.com/' + owner + '.atom';
var reader = 'http://google.com/reader/view/feed/';
location.href = reader + encodeURIComponent(feed);
}
})(jQuery); void(0);
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。