use system() instead of backticks where applicable
This commit is contained in:
@@ -26,7 +26,7 @@ if (-f "/bin/wget") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $script_name = "Image URL Auto Grabber and Downloader, wget flavour";
|
my $script_name = "Image URL Auto Grabber and Downloader, wget flavour";
|
||||||
HexChat::register($script_name, '0.8.1', 'Automatically grabs and downloads image URLs via wget', \&freehooks);
|
HexChat::register($script_name, '0.8.2', 'Automatically grabs and downloads image URLs via wget', \&freehooks);
|
||||||
|
|
||||||
HexChat::print("$script_name loaded\n");
|
HexChat::print("$script_name loaded\n");
|
||||||
my @hooks;
|
my @hooks;
|
||||||
@@ -80,7 +80,7 @@ sub dlfunc(@) {
|
|||||||
my $file = shift;
|
my $file = shift;
|
||||||
|
|
||||||
$url = urlencode($url);
|
$url = urlencode($url);
|
||||||
`$wgetpath --no-check-certificate -q -T 20 -O '$file' -o /dev/null '$url'`;
|
system($wgetpath, '--no-check-certificate', '-q', '-T', '20', '-O', $file, '-o', '/dev/null', $url);
|
||||||
|
|
||||||
if ($file =~ /(png|jpe?g|gif)$/i){
|
if ($file =~ /(png|jpe?g|gif)$/i){
|
||||||
my $im = Image::Magick->new();
|
my $im = Image::Magick->new();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ my $help = 'Usage:
|
|||||||
/notify show - shows whitelists and their statuses
|
/notify show - shows whitelists and their statuses
|
||||||
';
|
';
|
||||||
|
|
||||||
register($script_name, '0.7', 'Sends *nix desktop notifications', \&freehooks);
|
register($script_name, '0.7.1', 'Sends *nix desktop notifications', \&freehooks);
|
||||||
|
|
||||||
HexChat::print("$script_name loaded\n");
|
HexChat::print("$script_name loaded\n");
|
||||||
my @hooks;
|
my @hooks;
|
||||||
@@ -106,7 +106,7 @@ sub hookfn {
|
|||||||
|
|
||||||
sub notify(@) {
|
sub notify(@) {
|
||||||
my($topic, $text) = @_;
|
my($topic, $text) = @_;
|
||||||
`notify-send -u normal -t 12000 -a hexchat "$topic" -i hexchat "$text"`;
|
system("notify-send", "-u", "normal", "-t", "12000", "-a", "hexchat", $topic, "-i", "hexchat", $text);
|
||||||
$active = 0;
|
$active = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user