-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
124 lines (124 loc) · 3.11 KB
/
background.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
function getDiliHtml(){
var value;
$.ajax({
url:'http://www.dilidili.name',
type:"GET",
dataType:"html",
cache:false,
async:false,
success:function(result){
var $result = $("<code></code>").append($(result));
var $html = $("div.main", $result).eq(0)
.children("div.side")
.children("div.change").eq(1)
.children().eq(0);
$html.find("a").each(function(){
$(this).attr('target','_blank');
});
value = $html.html();
}
});
return value;
}
function getQQHtml(){
var value;
$.ajax({
url:'https://v.qq.com/channel/cartoon',
type:"GET",
dataType:"html",
cache:false,
async:false,
success:function(result){
var $result = $("<code></code>").append($(result));
var $html = $("div#v_cartoon_days_broadcast", $result).children().eq(1);
$html.find("img").each(function(){
if(typeof($(this).attr("lz_next")) == "undefined"){
$(this).attr("src","https:" + $(this).attr("src"));
}else{
$(this).attr("src","https:" + $(this).attr("lz_next"));
}
});
$html.children().each(function(){
$(this).children().each(function(){
$(this).children()[1].remove();
});
});
value = $html.html();
}
});
return value;
}
function getWeiboHtml(){
var value;
$.ajax({
url:'https://s.weibo.com/top/summary?cate=realtimehot',
type:"GET",
dataType:"html",
cache:false,
async:false,
success:function(result){
var $result = $("<code></code>").append($(result));
var $html = $("#pl_top_realtimehot", $result).find("tbody");
$html.find("a").each(function(){
$(this).attr("href","https://s.weibo.com" + $(this).attr("href"));
});
$html.find("img").each(function(){
$(this).attr("src","https:" + $(this).attr("src"));
});
value = $html.html();
}
});
return value;
}
function get91Html(day){
var value;
var url = "https://91mjw.com/schedule?";
if(day == 1) url += "Monday";
if(day == 2) url += "Tuesday";
if(day == 3) url += "Wednesday";
if(day == 4) url += "Thursday";
if(day == 5) url += "Friday";
if(day == 6) url += "Saturday";
if(day == 0) url += "Sunday";
$.ajax({
url: url,
type:"POST",
dataType:"html",
cache:false,
async:false,
success:function(result){
var $result = $("<code></code>").append($(result));
var $html = $("div.m-movies", $result);
$html.find("img").each(function(){
$(this).attr("src", $(this).attr("data-original"));
});
$html.find("a").each(function(){
$(this).attr('target','_blank');
});
value = $html.html();
}
});
return value;
}
function getDoubanHtml(){
var value;
$.ajax({
url: 'https://movie.douban.com/',
type:"POST",
dataType:"html",
cache:false,
async:false,
success:function(result){
var $result = $("<code></code>").append($(result));
var $html = $("div#screening", $result).children().eq(1).children();
$html.find(".ticket_btn").each(function(){
$(this).remove();
});
$html.find("a").each(function(){
$(this).attr('target','_blank');
});
value = $html.html();
}
});
return value;
}