Skip to content

Instantly share code, notes, and snippets.

@tjlytle
Created May 27, 2010 22:13
Show Gist options
  • Save tjlytle/416430 to your computer and use it in GitHub Desktop.
Save tjlytle/416430 to your computer and use it in GitHub Desktop.
Drop.io Shell Script
#!/bin/bash
#I am not a bash scripter, this is my feeble attempt to create
#a drop.io cli uploader by cobbling together various ideas found
#on the internet. Perhaps someone will see this and say, "Silly
#bash script n00b, I'll show you how it's done."
#
#That's fine by me.
drop()
{
FILE=$1
DROPNAME=$2
curl -F version=1.0 -F api_key=$APIKEY -F drop_name=$DROPNAME -F "file=@$FILE" http://assets.drop.io/upload
}
APIKEY="XXXXXXXXXXXXX"
arg2=$1
shift
while [[ "$1" != "" ]] ; do
drop $1 $arg2
shift
done
@dropio
Copy link

dropio commented May 27, 2010

Hi, this is Eric from drop.io. I saw this gist in a tweet listed as a way to create assets during our downtime.

We're currently doing some unplanned maintenance on our database. While the site is down, there may be some API methods that still appear to work, but files created during this time may not be there after the database restore. Sorry for the inconvenience, and we'll have the site and API back up as quickly as possible!

@tjlytle
Copy link
Author

tjlytle commented May 28, 2010

Sorry, wasn't my intention to get around the downtime - I didn't realize that was possible, and have no idea if this would accomplish that. I simply couldn't use this because of the downtime, and figured I'd take the break to share it. The "somehow managed to get working" was in reference to my bash script abilities, not that I was using drop.io during the downtime (http://twitter.com/tjlytle/status/14862684433).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment