/*
* @title Subscribe Gists
* @description Subscribe Public Gists (Atom).
* @include https://gist.github.com/*
* @license MIT License http://nrm.mit-license.org/2012+
* @see https://support.google.com/chrome/bin/answer.py?hl=ja&answer=1342714
* @require
*/
// 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();
} else if (/^https:\/\/gist\.github\.com\/(\w+)/.test(location.href)) {
owner = RegExp.$1;
}
//console.info('*owner: ' + owner);
if (owner) {
var reader = 'http://google.com/reader/view/feed/';
location.href = reader + encodeURIComponent('https://gist.github.com/' + owner + '.atom');
}
})(jQuery);