FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
userscript/scripts/moreRss.user.js at master · charygao/userscript · GitHub
charygao
userscript
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
userscript
/
scripts
/
moreRss.user.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
49 lines (43 loc) · 1.14 KB
Breadcrumbs
userscript
/
scripts
/
moreRss.user.js
Copy path
File metadata and controls
49 lines (43 loc) · 1.14 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
37
38
39
40
41
42
43
44
45
46
47
48
49
// ==UserScript==
//
@name
More RSS
//
@namespace
https://github.com/ywzhaiqi/
//
@version
0.1
//
@description
给优酷专辑新增 RSS 让其可订阅。chrome 用户需要安装 rss 检测扩展:RSS Subscription Extension。
//
@include
http://i.youku.com/u/*
//
@grant
none
//
@noframes
//
@run
-at document-start
// ==/UserScript==
function
$C
(
name
,
attr
)
{
var
el
=
document
.
createElement
(
name
)
;
if
(
attr
)
{
Object
.
keys
(
attr
)
.
forEach
(
function
(
n
)
{
el
.
setAttribute
(
n
,
attr
[
n
]
)
;
}
)
;
}
return
el
;
}
function
addRss
(
url
,
title
)
{
var
link
=
$C
(
'link'
,
{
rel
:
"alternate"
,
type
:
"application/rss+xml"
,
title
:
title
||
'More RSS'
,
href
:
url
}
)
;
document
.
head
.
appendChild
(
link
)
;
}
/**
* 由于运行在 document-start,无法访问完整的 DOM
*/
function
init
(
)
{
var
url
=
location
.
href
.
replace
(
/
^
h
t
t
p
s
?
:
\/
\/
/
,
''
)
,
host
=
location
.
host
,
rss
;
switch
(
true
)
{
case
!
!
url
.
match
(
/
i
\.
y
o
u
k
u
\.
c
o
m
\/
u
\/
(
\w
+
)
/
)
:
// http://i.youku.com/u/UNTEzNTY1OTgw
rss
=
'http://www.youku.com/user/rss/id/'
+
RegExp
.
$1
;
addRss
(
rss
,
document
.
title
)
;
break
;
}
}
init
(
)
;
Back
|
FazBrowse Home
|
New Git URL