# Neocities In Rc, Again I made the script 'functional' for fun. The usage is the same. If you don't use Tor, remove "--socks5-hostname 127.0.0.1:9050". To explain the mechanism, $* is now a list. What main does is main (x:xs) = Apply x to xs (if x is up, del, info) = List files (if x is list) = Print the usage (else) `````````````````````````````````````````````````````````````````` #!/usr/local/bin/rc username = $NEOCITIES_USER key = $NEOCITIES_KEY api = 'https://'$username'@neocities.org/api/' # Definition fn curl { builtin curl -H 'Authorization: Bearer '$key --socks5-hostname 127.0.0.1:9050 $* } fn up { curl -F $1'=@-' <$1 $api^'upload' } fn del { curl -d 'filenames[]='$1 $api^'delete' } fn list { curl $api^'list' } fn info { curl $api ^ 'info?sitename='$1 } fn usage { echo 'Upload Files: n up file1 file2 ...' echo 'Delete Files: n del file1 file2 ...' echo 'List Files: n list' echo 'Site Info: n info user1 user2 ...' } # main switch($1) { case up del info apply $* case list list case * usage } ``````````````````````````````````````````````````````````````````