Skip to content

Instantly share code, notes, and snippets.

Created April 12, 2013 09:08
Show Gist options
  • Save anonymous/5370691 to your computer and use it in GitHub Desktop.
Save anonymous/5370691 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Mac::Pasteboard;
my $pb = Mac::Pasteboard->new();
my $text = '';
while(1) {
sleep(1);
my $t = $pb->paste();
next if $t eq $text;
if ($t =~ qr{^http://}) {
system("open $t");
}
$text = $t;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment