-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
100 lines (92 loc) · 3.46 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Check Current Nintendo Switch Firmware Version</title>
<style>
body {
text-align: center;
font-weight: bold;
font-family: sans-serif;
}
h1 {
font-size: 2em;
margin-top: 1em;
}
#answer {
font-size: 4em;
}
footer {
text-align: center;
margin-top: 100px;
}
</style>
</head>
<body>
<h1>What is the newest/current firmware version being pushed out to the Nintendo Switch?</h1>
<p id="answer" title="According to yellows8's page">Checking...</p>
<br/>
<h1>Time since last firmware release:</h1>
<h1 id="age">Checking...</h1>
<footer>Useful links
<br/>
<a href="https://www.reddit.com/r/SwitchHaxing/comments/5z21np/nintendo_switch_official_hacking_guide/">Switch
Hacking Guide</a> --
<a href="https://www.reddit.com/r/SwitchHaxing/">Reddit</a> --
<a href="https://yls8.mtheall.com/ninupdates/reports.php">Powered by yellows8</a>
</footer>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-dateFormat/1.0/jquery.dateFormat.js"></script>
<script>
jQuery(document).ready(function ($) {
setTimeout(function () {
var COLORS = [
'#e21400', '#91580f', '#f8a700', '#f78b00',
'#58dc00', '#287b00', '#a8f07a', '#4ae8c4',
'#3b88eb', '#3824aa', '#a700ff', '#d300e7'
];
function getVersionColor(version) {
// Compute hash code
var hash = 7;
for (var i = 0; i < version.length; i++) {
hash = version.charCodeAt(i) + (hash << 5) - hash;
}
// Calculate color
var index = Math.abs(hash % COLORS.length);
return COLORS[index];
}
$.ajax({
url: 'https://api.rss2json.com/v1/api.json',
method: 'GET',
dataType: 'json',
data: {
rss_url: 'https://yls8.mtheall.com/ninupdates/feed.php',
api_key: 'njke4g4qls3gbcn9zq90cbs2fzimry3zwnbssvsm'
}
}).done(function (data) {
$verPos = (function (items) {
var i = 0;
$.each(items, function (k, v) {
if (v.title.indexOf("Switch ") !== 0) {
i++;
} else {
return false;
}
});
return i;
})(data.items);
$verKey = data["items"][$verPos];
$verNum = $verKey["title"].split(" ")[1];
$dateTimeParts = $verKey["pubDate"].split(" ");
$timeParts = $dateTimeParts[1].split(':');
$dateParts = $dateTimeParts[0].split('-');
$date = new Date($dateParts[0], parseInt($dateParts[1], 10) - 1, $dateParts[2], $timeParts[0], $timeParts[1]);
$('#answer').text($verNum).css("color", getVersionColor($verNum));
$('#age').html("~" + $.format.prettyDate($date) + "<br />");
$('#age').append("(" + $.format.date($date, "MMM D yyyy @ h:mm a") + " UTC)");
});
}, 50);
});
</script>
</html>