From bbf9995ea023fe928fa9906edf50f6475f841b5a Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 25 Jul 2014 11:01:29 +0100 Subject: Add plain text and lightweight formats --- index.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index 9502134..1dcac7b 100644 --- a/index.php +++ b/index.php @@ -306,5 +306,15 @@ for ($i = 0; $i < count($listing); $i++) { echo json_encode($listing); } else if ($_GET['format'] == "raw") { print_r($listing); +} else if ($_GET['format'] == "plain") { + header("Content-type: text/plain"); + + for ($i = 0; $i < count($listing); $i++) { + echo $listing[$i]['filename'] . "\n"; + } +} else if ($_GET['format'] == "light") { + for ($i = 0; $i < count($listing); $i++) { + echo '' . $listing[$i]['filename'] . '
'; + } } ?> -- cgit v1.2.3