scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

commit 8f0792c01524278f4a16265b44c0d03bbe4bb3af
parent 269348b447811b7cab7e1152d16442df2123a736
Author: haris <haris@metal.lan>
Date:   Wed Jun 26 20:08:08 +0300

Weechat script for shorting url.

Diffstat:
shorturl.pl | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/shorturl.pl b/shorturl.pl @@ -0,0 +1,17 @@ +# weechat script for url shorting +# Needed: WWW::Shorten::TinyURL +use strict; +use WWW::Shorten::TinyURL; +use Clipboard; + +weechat::register("shorten", "cipher <haris\@2f30.org", "0.1", "Public Domain", + "Short url", "", ""); +weechat::hook_command("shorten", "Press \"/shorten\" to output on the channel/buffer what shorten is currently playing", "", "", "", "shorten", ""); + +sub shorten { + my $external = Clipboard->paste; + my ($data, $buffer, $args) = @_; + my $short_url = makeashorterlink($external); + weechat::command($buffer, "url: $short_url"); + return weechat::WEECHAT_RC_OK; +}