+Youtube
by
noromanba
2012-12-14 [2012/12/14 09:22:27]
Subscribe Youtube feed (Atom, RSS)
@@ -7,33 +7,33 @@
* @license MIT License http://nrm.mit-license.org/2012
* @author noromanba (https://flavors.me/noromanba)
*
- * # Feeds
- * - large thumbnail ver.
- * https://gdata.youtube.com/feeds/base/users/youtube/uploads
- * - default feed, register from browser
- * https://gdata.youtube.com/feeds/base/users/youtube/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile
- * - tiny query ver.
- * https://gdata.youtube.com/feeds/base/users/youtube/uploads?alt=rss&v=2&orderby=published
- *
- * - alternate gateway (user: youtube)
- * https://www.youtube.com/rss/user/youtube/videos.rss
- * - exepanded alt-gw. default order by updated
- * https://gdata.youtube.com/feeds/base/users/youtube/uploads?orderby=updated&alt=rss&client=ytapi-youtube-rss-redirect&v=2
- *
*/
-// no handling artist tag or any other feeds
+// # Feeds
+// - large thumbnail ver.
+// https://gdata.youtube.com/feeds/base/users/youtube/uploads
+// - default feed, register from browser
+// https://gdata.youtube.com/feeds/base/users/youtube/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile
+// - tiny query ver.
+// https://gdata.youtube.com/feeds/base/users/youtube/uploads?alt=rss&v=2&orderby=published
+//
+// - alternate gateway (user: youtube)
+// https://www.youtube.com/rss/user/youtube/videos.rss
+// - exepanded alt-gw. default order by updated
+// https://gdata.youtube.com/feeds/base/users/youtube/uploads?orderby=updated&alt=rss&client=ytapi-youtube-rss-redirect&v=2
+
+// only channel feeds, no handling artist tag or any other feeds
// c.f. https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds
(function () {
if (!(/^https?:\/\/www\.youtube\.com/.test(location.href))) return;
var user = (/^https?:\/\/www\.youtube\.com\/user\/(\w+)/.exec(location.href) || [])[1] ||
- (document.querySelector('[rel=author]') || {}).textContent;
+ (document.querySelector('#watch7-user-header .yt-user-name') || {}).textContent;
if (!user) return;
var reader = 'https://www.google.com/reader/view/feed/';
var feed = (function () {
- // TBD make https:
+ // TBD make https
var origin = 'http://gdata.youtube.com/feeds/base/users/' + user + '/uploads';
return {
small: origin + '?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile',
/*
* @title +Youtube
* @description Subscribe Youtube feed (Atom, RSS)
* @include http://www.youtube.com/*
* @include https://www.youtube.com/*
* @require
* @license MIT License http://nrm.mit-license.org/2012
* @author noromanba (https://flavors.me/noromanba)
*
*/
// # Feeds
// - large thumbnail ver.
// https://gdata.youtube.com/feeds/base/users/youtube/uploads
// - default feed, register from browser
// https://gdata.youtube.com/feeds/base/users/youtube/uploads?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile
// - tiny query ver.
// https://gdata.youtube.com/feeds/base/users/youtube/uploads?alt=rss&v=2&orderby=published
//
// - alternate gateway (user: youtube)
// https://www.youtube.com/rss/user/youtube/videos.rss
// - exepanded alt-gw. default order by updated
// https://gdata.youtube.com/feeds/base/users/youtube/uploads?orderby=updated&alt=rss&client=ytapi-youtube-rss-redirect&v=2
// only channel feeds, no handling artist tag or any other feeds
// c.f. https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds
(function () {
if (!(/^https?:\/\/www\.youtube\.com/.test(location.href))) return;
var user = (/^https?:\/\/www\.youtube\.com\/user\/(\w+)/.exec(location.href) || [])[1] ||
(document.querySelector('#watch7-user-header .yt-user-name') || {}).textContent;
if (!user) return;
var reader = 'https://www.google.com/reader/view/feed/';
var feed = (function () {
// TBD make https
var origin = 'http://gdata.youtube.com/feeds/base/users/' + user + '/uploads';
return {
small: origin + '?alt=rss&v=2&orderby=published&client=ytapi-youtube-profile',
tiny : origin + '?alt=rss&v=2&orderby=published',
large: origin
};
})();
location.href = reader + encodeURIComponent(feed.small);
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。