From: Penny Leach Date: Tue, 15 Sep 2009 08:41:30 +0000 (+0200) Subject: added liip.to script X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f05ccbf8a48e1e08637d1b861fe5330185849cea;p=scripts.git added liip.to script --- diff --git a/bin/liip b/bin/liip new file mode 100755 index 0000000..b871d04 --- /dev/null +++ b/bin/liip @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w + +use strict; +use LWP::UserAgent; + +my $service = 'http://liip.to/api/txt/'; +my $url = $ARGV[0]; +my $code = $ARGV[1]; + +$url ||= scalar(`xclip -o`); +$code ||= ''; + +$url =~ s/\s$//; +$code =~ s/^\s//; +$code =~ s/\s$//; + + +my $postargs = ['url', $url, 'code', $code ]; + +my $response = LWP::UserAgent->new->post($service, $postargs); +print $response->content . "\n";