diff --git a/scripts/downcode.php b/scripts/downcode.php new file mode 100644 index 0000000..f2a7fda --- /dev/null +++ b/scripts/downcode.php @@ -0,0 +1,20 @@ + 2) { + die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); +} + +//Process the provided argument +if($argc === 2) { + $s = $argv[1]; +//Or read from stdin if the argument wasn't present +} else { + $piped = true; + $s = file_get_contents("php://stdin"); +} + +echo URLify::downcode ($s) . ($piped ? "\n" : ""); diff --git a/scripts/filter.php b/scripts/filter.php new file mode 100644 index 0000000..aec6a0a --- /dev/null +++ b/scripts/filter.php @@ -0,0 +1,20 @@ + 2) { + die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); +} + +//Process the provided argument +if($argc === 2) { + $s = $argv[1]; +//Or read from stdin if the argument wasn't present +} else { + $piped = true; + $s = file_get_contents("php://stdin"); +} + +echo URLify::filter ($s) . ($piped ? "\n" : ""); diff --git a/scripts/transliterate.php b/scripts/transliterate.php new file mode 100644 index 0000000..258581b --- /dev/null +++ b/scripts/transliterate.php @@ -0,0 +1,20 @@ + 2) { + die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); +} + +//Process the provided argument +if($argc === 2) { + $s = $argv[1]; +//Or read from stdin if the argument wasn't present +} else { + $piped = true; + $s = file_get_contents("php://stdin"); +} + +echo URLify::transliterate($s) . ($piped ? "\n" : "");