Files

88 lines
3.0 KiB
PHP
Raw Permalink Normal View History

2025-12-09 06:52:43 +00:00
<?php
error_reporting(E_ALL);
$furnidata_txt_link = "https://swf.habbocity.me/gamedata/furnidata_2884441y959994259.txt?1616421544";
$arrRequestHeaders = array(
'http'=>array(
'method' =>'GET',
'protocol_version' =>1.1,
'follow_location' =>1,
'header'=> "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
));
$data = file_get_contents($furnidata_txt_link, false, stream_context_create($arrRequestHeaders));
$data = utf8_encode($data);
$xml = '<?xml version="1.0"?>
<furnidata>
<roomitemtypes>';
$data = str_replace("&", "et", $data);
$data = str_replace("<", "", $data);
foreach(explode('[',$data) as $premier) {
$var = explode('",',$premier);
$var = str_replace('"','', $var);
$var = str_replace('],','', $var);
if($var[0] == 's') {
$xml .= '<furnitype id="'.$var[1].'" classname="'.$var[2].'">
<revision>'.$var[3].'</revision>
<defaultdir>'.$var[4].'</defaultdir>
<xdim>'.$var[5].'</xdim>
<vdim>'.$var[6].'</vdim>
<partcolors>';
$colors = explode(',', $var[7]);
foreach($colors as $color) {
$xml .= '<color>'.$color.'</color>';
}
$xml .= '</partcolors>
<name>'.$var[8].'</name>
<description>'.$var[9].'</description>
<customparams>';
if(empty($var[13]) && !isset($var[13])) {
$xml .= '1';
} else {
$xml .= $var[13];
}
$xml .= '</customparams>
<specialtype>';
if(empty($var[14]) && !isset($var[14])) {
$xml .= '1';
} else {
$xml .= $var[14];
}
$xml .= '</specialtype>
</furnitype>
';
}
}
$xml .= '</roomitemtypes>
<wallitemtypes>';
foreach(explode('[',$data) as $premier) {
$var = explode('",',$premier);
$var = str_replace('"','', $var);
if($var[0] == 'i') {
$xml .= '<furnitype id="'. $var[1].'" classname="'.$var[2].'">
<revision>'.$var[3].'</revision>
<name>'.$var[8].'</name>
<description>'.$var[9].'</description>
</furnitype>
';
}
}
$xml .= '</wallitemtypes>
</furnidata>';
$fichier = fopen('furnidata.xml', 'w+');
$resultat = fwrite($fichier, $xml);
fclose($fichier);