TOP 55 Maze point scorers of all time!

Crazypkr

Active Player
Greenie
Feb 19, 2016
25
6
I would love to write a script pulling this data and listing it on a website, but unfortunately my capabilities are limited when it comes to this. It' would also be great to intergrate a similar feature with timings.
Hey @Chillers , if all the data is logged inside a text file, it would be very easy to use JavaScript to read the file and place the data into a table for the Internet. I have been working on web programming for the past couple of months and I am capable of probably helping you guys achieve this. One website I have been making is a portfolio website for a job I want to do. You can visit nicholaslac.com to see the website in the working so far :)


Also, this wouldn't be automatic due to the fact you would need a database to do so, but your able to make it semi automatic by uploading the file every month to "refresh" it.
 

Srentiln

minr op since Nov 2011
Op
Oct 28, 2013
1,934
838
I believe the data is automatically inserted into whatever storage file automatically by the plugin. The main issue would be file access. In the case of files used by the server, javascript alone is not a good idea for security reasons. Using PHP to pull the data with one page and javascript on a separate page to be able to refresh the data would be a far better idea.

For example:

if it is a text document:
PHP:
<?php
//set the delimiter used in the data.  If CSV, use ","
$delim = " ";
$myfile = fopen("file address", "r") ordie("Unable to open file!");
$dataarray = explode($delim,$myfile);
fclose($myfile);
$t = 0;
echo "<table><tr><th>Name</th><th>Points</th></tr>";
foreach($dataarray as $data)
 {
  if($t == 0)
   {
    echo "<tr><td>" . $data . "</td>";
    $t = 1;
   }
 else
  {
   echo "<td>" . $data . "</td></tr>";
   $t = 0;
  }
}
 ?>
if it is in a database format:

PHP:
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} 

$sql = "SELECT name, points FROM database";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo"id: " . $row["Name"]. " - Name: " . $row["Points"]. "<br>";
}
} else {
echo"0 results";
}
$conn->close();
?>
with
Code:
<script>
function points(){
var x=document.getElementById("right");
x.innerHTML ='<?php include_once "include.php";?>';
}
points();
</script>
Would need some cleaning up, but it would be a bit more secure.
 
Last edited:

Chillers

Administrator
Op
Oct 26, 2013
1,525
819
The file consists of UUID's aswell so the UUID name of the player would need to be pulled elsewhere or linked.
 

Crazypkr

Active Player
Greenie
Feb 19, 2016
25
6
I believe the data is automatically inserted into whatever storage file automatically by the plugin. The main issue would be file access. In the case of files used by the server, javascript alone is not a good idea for security reasons. Using PHP to pull the data with one page and javascript on a separate page to be able to refresh the data would be a far better idea.

For example:

if it is a text document:
PHP:
<?php
//set the delimiter used in the data.  If CSV, use ","
$delim = " ";
$myfile = fopen("file address", "r") ordie("Unable to open file!");
$dataarray = explode($delim,$myfile);
fclose($myfile);
$t = 0;
echo "<table><tr><th>Name</th><th>Points</th></tr>";
foreach($dataarray as $data)
{
  if($t == 0)
   {
    echo "<tr><td>" . $data . "</td>";
    $t = 1;
   }
else
  {
   echo "<td>" . $data . "</td></tr>";
   $t = 0;
  }
}
?>
if it is in a database format:

PHP:
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT name, points FROM database";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo"id: " . $row["Name"]. " - Name: " . $row["Points"]. "<br>";
}
} else {
echo"0 results";
}
$conn->close();
?>
with
Code:
<script>
function points(){
var x=document.getElementById("right");
x.innerHTML ='<?php include_once "include.php";?>';
}
points();
</script>
Would need some cleaning up, but it would be a bit more secure.

Yes, I thought about that and your right that php would be a better way to pull the file information. I actually thought that instead what we can do is pull the information from the file using php, connect the php script to the JavaScript file using Ajax, use JavaScript to place the information in a nice table and use CSS and HTML to display it in a nice manner. Also, for the issue of getting the uuid, what I can do is set up the table so that you can look up your name from a username finder, and then copy that uuid and paste it into a search.

EDIT

Or just pull it off of minecrafts' api
http://wiki.vg/Mojang_API
 
Top