-
Notifications
You must be signed in to change notification settings - Fork 166
/
Copy pathYouku_RSS.user.js
36 lines (33 loc) · 4 KB
/
Youku_RSS.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// ==UserScript==
// @name Youku RSS
// @version 2014.8.15
// version 0.2.2
// @namespace https://userscripts.org/users/256199
// @author NightsoN
// @description 在视频空间和专辑页面添加RSS订阅链接
// @include http://u.youku.com/user_show/*
// @include http://i.youku.com/u/*
// @include http://www.youku.com/playlist_show/*
// @icon http://youku.com/favicon.ico
// @grant none
// ==/UserScript==
/*
http://www.youku.com/show_page/id_z6939e1f4c08611e38b3f.html
这个网址怎么得到 RSS 订阅地址?
*/
var locationHref = location.host + location.pathname;
var rssImg = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAG+0lEQVRIiVWWa1CU1x3G36YzaT/3Uy9RrLAbwi7gArv7LmvsdHQy02mt6QdiZ9JYExOtctvlooEAQgFFwQURFISx6jh2YkzbTGtb24o6qZOpTTSJsFzSRK4L7J29397z64clKP+Z58uZeZ/n//zP+5xzJEmSviGt1vX9Bqu9YrNj6nCuMlWrFWnksoaaXCa/RnUaE1aNmLBqxHiVRhk9kOF493WDVVpXzc3PNO/d++0Ri+nyQoscXjwqK453DGKp0SCWW4w4W4242mXcx2U8J0x4O4vxdRXj7y5m5bSZwJmtBPvMIthvFsH+bcpSR3F4pMx4qby8/FtSc/MzkiRJ0ojFeDnQbmC+eouYOZQl5sozcVRns1SXy3KTDleLDnfrFrztOnwnCljpKiBgKyTUW0S4r4jIWT3RAQOx83qRvLhVJPvNjJTrr0iSJEnvvWmyOFpkZb5al5opVyuLrdtxntopnG3bcDbm4azLxN2gwntMh6/TwEpXEYFuPcFePeE+A5GzRqLnjEQHjSI2JBMb1CuJ4ReTrg4TF97a/jPJXrHZt9gki1lLLnOlGYTv/1EApMI+EouTRD+5TvA9K/4u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ngUeH8xj6ldZYtaqx25RC2ncqhHBvmIROScT6c4mNXkDoaRQ4iGEkiQ19wmBk1p8LSqi/x5Kp1lJEfn0b8wd+B5Lx36OSCbS3yRiTNduZ2L3JmYseuxWtZAmLBoR7DeL6IBM9IxGJG41rHMQu9uLvzUbd1M2K1crnnTrnmW2TM1crYxIJtbW51p/Kewvf19MV+jFeJUa6fPfbPIGz24T8fMGYkMm4oM6kRhpJTn1T2J3uvF36NLxb9Dgtu0kOnab6OhtgveuMVOmZbo0j5UP3yf04BbBB7fEdP1Oxl7eoMzWyOLRwY1j0rW9+srlDpOSvPhiKjaoV6IDMuFTL4hAxwv4Wp9fjX8Byw06Fg/nMl+eyezBzUzvz2T6oIav9ufwxaubmNy9QUy8shH7K5uVyT15SUeTgYv7d/xUkiRJ+leZ8VKiv5jE8FYlfKZIBLq/Prh0wtWUz1JdHo7aXOartMxW5jJTquXxgRy+fCObL15Ti6nXspl4NZvx3Wox9etcxdeo547FcPnJpV9S8uxImeGS67gpFej9EX6bWfg6zXg6inG3mXD+Vmb5qMxSgxFHvYGFIwbma/XMVRUxay1iprKQ6bICMVsj42g0pO5UGi41l5Q8W1JS8s11D4yhN3fserjvuYePSjOV0dIsMVqWJcbKVYxVqBirVGGvVGO3rMKqZtyqZtyiEuNWlRivUimfHdr48MKBHbue5vw/tQdGSghfgsYAAAAASUVORK5CYII=';
if (locationHref.match(/u\.youku\.com\/user_show\//)){
document.getElementById("spaceUrl").insertAdjacentHTML('afterend',
'<a class="pLinkCopy fPLink" href="http://www.youku.com/user/rss/id/' + window.userId + '")">订阅</a>');
} else if (locationHref.match(/i\.youku\.com\/u\//)){
// http://i.youku.com/u/UNTEzNTY1OTgw
var html = '<li>' +
'<a target="_blank" title="订阅到 RSS" href="http://www.youku.com/user/rss/id/' + (window.to_user_id || window.ownerEncodeid) + '">' +
'<img class="ico" src="' + rssImg + '" />' +
'</a></li>';
document.querySelector(".share-list > ul").insertAdjacentHTML('afterbegin', html);
} else if (locationHref.match(/www\.youku\.com\/playlist_show\//)){
document.querySelector('.listsub .handle').insertAdjacentHTML('beforeend',
'<a> | </a><a href="' + document.querySelector('link[rel="alternate"]').href + '">RSS订阅</a>');
}