-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrating.js
40 lines (36 loc) · 1.08 KB
/
rating.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
37
38
39
40
function attachRatingEvent() {
function createOptions($target) {
const nameStr = $.trim($target.find('a').text()) ||
$.trim($target.find('a').attr('alt'));
const nameYear = TitleParser.parse(nameStr)
const options = {
name: nameYear.name,
year: nameYear.year,
type: "movie"
};
return options;
}
listHandle(createOptions, '.rarbag h3, .img');
}
function attachRatingEvent4Dytt() {
function createOptions($target) {
const nameStr = $.trim($target.find('a').text());
const nameReg = /《([^》]+)》/;
const yearReg = /^\d{4}/;
const options = {
name: nameStr.match(nameReg)[1],
year: nameStr.match(yearReg)[0],
type: "movie"
};
return options;
}
listHandle(createOptions, '.dytt h3');
}
function listHandle(createOptions, tag) {
const modules = [new DoubanInfo(), new IMDBInfo()];
const common = new Common(modules, createOptions, 'movie');
common.listHandle(
/.*/i,
tag
);
}