Skip to content

Instantly share code, notes, and snippets.

@Shadey
Created August 7, 2014 23:28
Show Gist options
  • Save Shadey/756ded4b3062a60029ce to your computer and use it in GitHub Desktop.
Save Shadey/756ded4b3062a60029ce to your computer and use it in GitHub Desktop.
Hastebin Upload
if(@ARGV < 1){
print "Usage $0 filename1 filename2\n";
exit(1);
}
foreach (@ARGV){
my $file = `cat $_`;
my $r = `curl -s -X POST -d "$file" http://hastebin.com/documents`;
if($r =~ /\{"key":"(.*?)"\}/){
print "$_ : http://hastebin.com/$1\n";
}
else{
print "An error has occured\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment