blob: 08ee614dc4dede285a33c14c5054ce3390a67984 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/usr/bin/env perl
use strict;
use warnings;
use Capture::Tiny qw(capture);
use constant {
NEWSBOAT_PATH => 'newsboat',
NOTIFY_SEND_PATH => 'herbe'
};
sub main
{
my $stdout;
my $nb;
$nb = NEWSBOAT_PATH;
if (system(
$nb,
'-x',
'reload'
) != 0) {
exit 1;
}
$stdout = qx($nb -x print-unread);
$stdout =~ s/\s.+//;
chomp $stdout;
if ($stdout != 0) {
system(
NOTIFY_SEND_PATH,
' ' . $stdout . ' new articles'
);
}
return;
}
main();
__END__
|