-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathban-checker.html
144 lines (129 loc) · 4.06 KB
/
ban-checker.html
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
---
layout: page
permalink: /ban-checker/
title: Ban Checker
modified: 15-5-2014
comments: false
---
{% raw %}
<style>
form#ban-check {
float: left;
margin-top: 10px;
}
form#ban-check input {
height: 50px;
font-family: 'PT Sans Narrow', sans-serif;
font-size: 18pt;
padding-left: 10px;
width: 400px;
}
.description {
float: left;
font-family: 'PT Sans Narrow', sans-serif;
font-size: 18pt;
width: 400px;
}
.result {
border-radius: 5px;
clear: both;
color: white;
display: none;
float: left;
font-family: 'PT Sans Narrow', sans-serif;
height: 100px;
padding: 10px;
text-transform: uppercase;
width: 380px;
}
.result h3 {
font-weight: normal;
margin: 0px;
}
.result a {
color: #fff;
font-weight: bold;
}
.result span {
color: #000;
font-weight: bold;
}
.result.success {
background-color: #78a410;
border: 1px solid #2e3c0d;
height: 270px;
}
.result.warn {
background-color: #f2a33c;
border: 1px solid #8f5211;
height: 70px;
}
.result.fail {
background-color: #ed6e6e;
border: 1px solid #7f1010;
height: 100px;
}
</style>
<form id="ban-check">
<div class="form-group pull-right">
<input type="text" class="form-control" placeholder="Twitch username" />
</div>
</form>
<p class="description">
Enter your Twitch username and press enter to make sure your account is actually banned before opening a ticket to Twitch support.
<br/>
It may save you a lot of time.
</p>
<div class="result"></div>
<script type="text/javascript">
function formResult(type, message) {
if(type === 'success') {
var title = "All is well!";
} else if(type === 'warn') {
var title = "Hmm, That's not right!";
} else {
var title = "Oh dear!";
}
$('.result').attr('class', 'result');
$('.result').html('<h3>' + title + '</h3>' + message);
$('.result').addClass(type);
$(".result").fadeIn();
}
$(document).ready(function() {
$('#ban-check').submit(function (e) {
e.preventDefault();
});
$('#ban-check').keyup(function(e) {
if (e.keyCode !== 13) return;
e.preventDefault();
$(".description").fadeOut(20);
var user = $('#ban-check input').val();
$.getJSON('https://api.twitch.tv/kraken/users/' + encodeURIComponent(user) + '?callback=?').done(function(data) {
var message = '';
if (/.+is unavailable$/.test(data.message)) { // Ban Check
message += 'It looks like you were banned from twitch, please open a ticket via the ';
message += '<a target="_blank" href="http://help.twitch.tv/">official twitch support</a> ';
message += 'site in order to see why you were banned.<br />';
message += '<span>TwitchTips cannot and will not help with your appeal</span>';
formResult('fail', message);
} else if (/.+is not available on Twitch$/.test(data.message) || /.+does not exist$/.test(data.message)) { // JTV/Nonexistant Check
message += 'That account is either not a Twitch account or it does not exist.';
formResult('warn', message);
} else {
message += 'The account provided does not seem to be banned on Twitch. ';
message += 'If you\'re seeing a message telling you that you\'re blocked from Twitch, ';
message += 'try disabling any VPN, proxy, or extension which re-routes traffic from your browser.<br/><br/>';
message += 'Got multiple accounts? Try checking those too because Twitch bans can be IP based.<br/><br/>';
message += 'If after doing so you are still getting the same error, ';
message += 'your ISP may have provided your modem with a previously banned IP address. ';
message += 'You can <a style="color: #fff" href="http://help.twitch.tv/" target="_blank"><strong>open a ticket</strong></a> with Twitch to check.';
formResult('success', message);
}
}).fail(function() {
var message = 'The Twitch API appears to have returned an invalid response. Twitch may be having issues at the moment.';
formResult('warn', message);
});
});
});
</script>
{% endraw %}