Published in: Perl
Shorter, more simple, but with a GUI. Requires GNOME (and the Zenity program, which comes by default with GNOME).
I recommend setting a hotkey with GNOME or Compiz (mine is Ctrl+Alt+A) to run this program, so when the hotkey is pressed you can quickly and easily shorten URLs.
#!/usr/bin/perl package shortLink; use LWP::UserAgent; use strict; my $url = readpipe('zenity --entry --title="shortLink" --text="Please enter a URL to shorten." --entry-text=""'); $shortLink::ua = LWP::UserAgent->new; my $r = $shortLink::ua->post('http://metamark.net/api/rest/simple', { long_url => $url }); sub errorCheck { if ( $response->is_success ) { } else { } }
You need to login to post a comment.
