Created
April 5, 2016 01:02
-
-
Save rchrd2/4fb3198053d107a81430e35a85a9e363 to your computer and use it in GitHub Desktop.
Neocities Upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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