Skip to content

Instantly share code, notes, and snippets.

@ScoreUnder
Forked from xy4n/pomfload
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScoreUnder/eb51d699cc908b789df9 to your computer and use it in GitHub Desktop.
Save ScoreUnder/eb51d699cc908b789df9 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Requires node.js: sudo pacman -Sy nodejs
if [ $# -lt 1 ]; then
echo "Usage: $(basename "$0") FILE [FILE...]" >&2
exit 1
fi
for f in "$@"; do
d=$(node -pe "JSON.parse(process.argv[1]).files[0].url" "$(curl -sS --progress-bar -F "files[]=@$f" http://pomf.se/upload.php)")
if [ $# -gt 1 ]; then
printf '%s:\t' "$f"
fi
echo "http://a.pomf.se/$d"
done

pomfload - upload to pomf from the comfort of your command line

usage: pomfload FILE [FILE [FILE...]]

what are you, stupid?

requirements

license

        DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
                    Version 2, December 2004 

 Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> 

 Everyone is permitted to copy and distribute verbatim or modified 
 copies of this license document, and changing it is allowed as long 
 as the name is changed. 

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 

  0. You just DO WHAT THE FUCK YOU WANT TO.
@ScoreUnder
Copy link
Author

I had no idea what package to find jq under so I'm using node instead. As loath as I am to use the thing it's the easiest way.

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