Skip to content

Instantly share code, notes, and snippets.

@cjmaxik
Last active May 8, 2021 17:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save cjmaxik/2c74dcc24251ad0ec71d8de497040d06 to your computer and use it in GitHub Desktop.
Save cjmaxik/2c74dcc24251ad0ec71d8de497040d06 to your computer and use it in GitHub Desktop.
World of Trucks loading screen pictures
<?php
$images = file_get_contents('http://lscreens.eut2.online.scssoft.com/eut2/lscr/data'); // Download WoT loading screens data file
$images = trim(substr($images, 1025)); // Trim and cut first 1024 symbols (idk what to do with it)
// Making array of things
$images_array = explode('\\n', json_encode($images));
foreach ($images_array as $key => &$value) {
$value = explode(';', $value);
}
/** RAW DATA ARRAY **/
var_dump($images_array);
$images_json = [];
foreach ($images_array as $key => $image) {
// User nickname
$images_json[$key]['nickname'] = $image[1];
// Loading Screen Picture
$images_json[$key]['image'] = "http://lscreens.eut2.online.scssoft.com/eut2/lscr_img/" . $image[2] . ".jpg";
// Picture ID in WoT
$image_hex = "0000000000000000" . dechex($image[5]);
$image_hex = strtoupper(substr($image_hex, strlen($image_hex) - 16));
// WoT Page
$images_json[$key]['page'] = "https://worldoftrucks.com/en/image_detail.php?id=" . $image_hex;
}
/** JSON DATA ARRAY **/
var_dump($images_json);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment