Skip to content

Instantly share code, notes, and snippets.

@rchrd2
Created April 5, 2016 01:02
Neocities Upload
#!/bin/bash
# Neocities provies an API for uploading files from ./public_html to your site
#
# Example Usage:
# $ USERNAME=username PASS=secret_pass bash upload_site.sh
function upload_file {
fullName=$1
shortName=${fullName:2}
curl -F "$shortName"="@$fullName" https://$USERNAME:$PASS@neocities.org/api/upload
}
cd public_html
find . | while read file; do upload_file "$file"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment