Files
zoff/php/convert_lists.php
Nicolas A. Tonne 55e27d0c50 Some perms
2014-10-10 14:09:26 +02:00

30 lines
610 B
PHP
Executable File

<?php
if(isset($_GET["pass"]) && $_GET["pass"]=="bæsj"){
include("change.php");
$dir = scandir('../lists');
$channels = array();
foreach($dir as $file){
if(strpos($file, '.json') !== FALSE){
$name='./lists/'.$file;
$data = json_decode(file_get_contents($name));
unlink($name);
checkFile($name); //should create a new file with correct stuff, in change
processList($data);
}
}
}else{
echo("kek");
}
function processList($list, $name){
foreach($list as $item){
//get id and title
addSong($name, $id, $title); //in change
}
}
?>