-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathqimai.user.js
154 lines (137 loc) · 6.74 KB
/
qimai.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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// ==UserScript==
// @name QiMai
// @version 2023.08.27
// @author ytzong
// @description QiMai
// @include http*://*qimai.*/*
// @include http*://app.sensortower.com/*
// @copyright ytzong
// @run-at document-end
// @grant GM_addStyle
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js
// @require https://cdn.rawgit.com/jprichardson/string.js/master/dist/string.min.js
// ==/UserScript==
let domain = location.host
let pathname = location.pathname
if (domain.includes('qimai')) {
GM_addStyle(`
body{overflow-x:hidden}
#footer-guide, .tool-side, a[href="http://u.qimai.cn/3xk"],
.data-table th, .data-table tr td:nth-child(1), .data-table tr td:nth-child(3), .data-table tr td:nth-child(5), .data-table tr td:nth-child(6), .data-table tr td:nth-child(8), .data-table tr td .rank-wrap .category,
#rank-top-list .data-table .comment-num,
#rank-top-list .data-table .app-info-wrap .app-info .company,
.ivu-tooltip, .ivu-tooltip-rel,
#footer,
.no-data,
.cm-explain-bottom,
.tip-ino,
#top-banner{display:none!important}
.layout-header, .head-box .head .container, .head-box .head, .jumbotron, .jumbotron>div .container{min-width:0!important}
.jumbotron>div .container{padding-left:25px!important;padding-right:25px!important}
.tab-container{width:400px}
.data-table tr td .app-info-wrap .rank-day{top:0!important;right:0!important}
.data-table tr{box-sizing: content-box;display:inline-block!important;vertical-align:top;position: relative;padding:0 0 15px;margin: 0 0 15px;width: 130px;}
.data-table td{display:block;width:auto!important;border:0 none !important}
.data-table tr td .app-info-wrap .app-info{margin-left:0!important;float:none!important}
#rank-top-list .data-table .app-info-wrap{min-width:0!important}
#rank-top-list .data-table .app-info-wrap .app-info .company,
#rank-top-list .data-table .rank-wrap{width:auto!important;max-width:100%!important;}
#rank-top-list .data-table .app-info-wrap .app-info .app-name{margin-top:5px!important;width:100%;white-space:normal!important;line-height:1.4;max-height:4.5em;-webkit-line-clamp:2;font-size:13px!important;text-align:center!important;font-weight:normal}
#rank-top-list .data-table .rank-wrap .rank-box,
.data-table tr td .rank-wrap .rank{display:inline-block!important;vertical-align:top;position:static!important; float:none!important;width:auto!important;margin-top:0!important}
.data-table tr td:nth-child(4){position:absolute;top:0;left:0;font-size:13px!important}
#rank-top-list .data-table .comment-rating{display:none;position:absolute;right:0;top:0}
.data-table tr td .app-info-wrap{padding:25px 0 0 !important}
.data-table tr td .app-info-wrap .icon{position:relative;margin-left: 15px;}
.data-table tr td .app-info-wrap .icon>img{width:100px!important;height:100px!important;border:0 none!important;border-radius:0 !important}
.data-table tr td .app-info-wrap .icon:after{content: "";width:100px;height:100px;background-image: url("https://rss.ytzong.com/css/img/mask100_2x.png");background-size: cover;position: absolute;top: 0;left: 0;}
.app-info .basic-info .app-screenshot .screenshot-list .screenshot-box img{max-height:500px!important;height:auto!important}
`);
if (pathname.includes('/rank/')) {
(function (history) {
var pushState = history.pushState;
history.pushState = function (state) {
window.setTimeout(function () {
location.reload()
}, 500)
return pushState.apply(history, arguments);
};
})(window.history);
}
window.setTimeout(function () {
let pub = $('.ivu-breadcrumb-item-link a').eq(0)
if (pub.length > 0) {
var publisherID = pub.attr('href')
console.log(publisherID)
if (publisherID.includes('/publisher/')) {
publisherID = publisherID.replace('/cn', '/us')
pub.attr('href', publisherID)
publisherID = publisherID.split('/')[4]
console.log(publisherID)
let sensortower = 'https://app.sensortower.com/ios/publisher/publisher/' + publisherID
$('.pub').wrap('<a href="' + sensortower + '" target="_blank" />').append(' »')
//location.href = sensortower
}
}
}, 2000)
window.setInterval(function () {
$('.head').removeClass('fixed')
$('.data-table a.icon').each(function () {
let appid = $(this).attr('href')
if (!appid.includes('apple.com')) {
appid = S(appid).replaceAll('/app/rank/appid/', '').replaceAll('/country/us', '').s
appid = 'https://apps.apple.com/us/app/id' + appid
$(this).attr('href', appid)
}
})
$('.app-name, .info-content .medium-txt a').each(function () {
let appName = $(this).text()
appName = S(appName)
.replaceAll('***', 'VPN')
.s
appName = appName.replace(/\\'/g, "'");
$(this).text(appName)
})
$('.data-table tr td:nth-child(4) .rank-txt').each(function () {
let rank = $(this).text()
rank = S(rank)
.replaceAll('新进榜', 'NEW')
.s
rank = rank.replace(/\\'/g, "'");
$(this).text(rank)
if (S(rank).contains('NEW')) {
$(this).parents('tr').css('background-color', 'yellow')
}
})
$('td:nth-child(5) .rank-a').each(function () {
if ($(this).text() != '-') {
$(this).parents('tr').css('background-color', 'yellow')
}
})
}, 2000)
}
if (domain.includes('sensortower')) {
GM_addStyle(`
.summary-item:last-child a,
.yt-highlight{background-color:yellow!important}
`);
window.setTimeout(function () {
$('div[data-test="app-overview-non-unified"]').prev().hide()
$('th.app-metric').eq(-1).click()
$('td.app-metric:last-child a').each(function () {
if (!$(this).text().includes('< $5k')) {
$(this).parents('tr').addClass('yt-highlight')
}
})
$('.app-icon a').each(function () {
let appID = $(this).attr('href').split('?')[0].split('/').slice(-1)[0]
let appURL = 'https://apps.apple.com/us/app/id' + appID
$(this).attr('href', appURL).attr('target', '_blank')
})
$('.app-info .name').each(function () {
let appID = $(this).attr('href').split('?')[0].split('/').slice(-1)[0]
let appURL = 'https://app.sensortower.com/overview/' + appID + '?country=US'
$(this).attr('href', appURL).attr('target', '_blank')
})
}, 1000)
}