Skip to content

Instantly share code, notes, and snippets.

@akiym
Last active December 23, 2015 23:29
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 akiym/6710203 to your computer and use it in GitHub Desktop.
Save akiym/6710203 to your computer and use it in GitHub Desktop.
Gyazo uploader
use strict;
use warnings;
use LWP::UserAgent;
my $filename = shift or die "Usage: $0 filename\n";
my $base_url = 'http://gyazo.com/';
my $ua = LWP::UserAgent->new;
my $res = $ua->post("$base_url/upload",
content_type => 'form-data',
content => {
imagedata => [$filename],
},
);
die $res->status_line unless $res->is_success;
printf "url: %s\n", $res->content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment