-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
100 lines (91 loc) · 3.14 KB
/
index.html
File metadata and controls
100 lines (91 loc) · 3.14 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Battlelog JSON Parser</title>
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="json-to-table.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$('#url').val("");
$('#nojs').hide();
$('#tooltip').hide();
$('#url').focus();
$("#url").keyup(function(event){
if(event.keyCode == 13){
$("#punch").click();
}
});
$('#punch').click(function(){
if($('#url').val() !== ""){
var it = $('#url').val();
if(it.indexOf("http://") !== -1){
it = it.substring(7);
}
if(it.indexOf("battlelog.battlefield.com/bf4/battlereport/show") !== -1){
it = it.substring(50);
var numbers = it.split("/");
if(numbers.length >= 2){
var finalURL = "http://battlelog.battlefield.com/bf4/battlereport/loadgeneralreport/" + numbers[0] + "/1/" + numbers[1] + "/";
it = "<a target='_blank' href=\"" + finalURL + "\">Here's your JSON!</a>";
}else{
it = "Try linking to a specific player's report.";
}
}else{
it = "That's not a Battle Report link, silly.";
}
$("#output").html(it);
}else{
$("#output").html("You didn't enter anything, silly.");
}
});
$("#json").keyup(function(event){
if(event.keyCode == 13){
$("#parse").click();
}
});
$('#parse').click(function(){
if($('#json').val() !== ""){
$('#tooltip').show( "slow", function() {
// Animation complete.
});
//var jsonHtmlTable = ConvertJsonToTable(objectArray
$('#parsed').html(JSON.stringify(JSON.parse($('#json').val()),null,4));
}else{
$("#parsed").html("You didn't enter anything, silly.");
};
});
});
</script>
<div style="font-family:Courier New, Courier, monospace; width: 700px;">
<p>
<h2>Battlelog JSON Parser 0.3.1</h2><br/>
Written by Analytalica for <a target='_blank' href="http://purebattlefield.org">PURE Battlefield</a></p>
<p id="nojs"><b>This page requires Javascript to function.</b></p>
<p><b>Enter a BattleReport URL... </b>(<a target='_blank' href="http://battlelog.battlefield.com/bf4/battlereport/show/1/409483006337486144/192741397/">like this one</a>)</p>
<p>
To get a specific player's report, click on the player's name
and then click the "Full Report" button. This lets you view the
JSON output in the context of that player.
</p>
<input type="text" id="url" style="width: 600px;" />
<button type="button" id="punch">Punch it.</button>
<p id="output">
</p>
<p><b>Once you get your JSON, copy and paste it (the whole page) here...</b></p>
<input type="text" id="json" style="width: 600px;" />
<button type="button" id="parse">Parse it.</button>
<p id="parsed" style="white-space: pre">
</p>
<div id="tooltip" style="z-index: 10;
position: fixed;
right: 20px;
top: 20px;
border: 1px solid black; width: 300px;">
Scroll down and look for <b>"playerReport": {</b>. The <b>"stats"</b> section should be nearby.
</div>
<p>If you want to save this page for offline use (in case this site ever goes down), grab the <a href="https://github.com/analytalica/BattlelogJSONer/">source files from GitHub</a> and open index.html from any browser.</p>
</div>
</body>
</html>