<?php
	$files = scandir(dirname(__FILE__) . "/");
	$taunts = array();
	
	foreach ($files as $file) {
		if ( ! str_ends_with($file, ".mp3") ) {
			continue;
		}
		$id = filemtime(dirname(__FILE__) . "/$file");
		$name = substr( $file, 0, strlen($file) - 4 );
		$path = rawurlencode($file);
		$taunts[] = array("name" => $name, "path" => $path, "id" => "$id");
	}
	
	$json = json_encode($taunts);
	echo $json;
?>