From b9778e3478c3ccf8ab27710ee996d1e853a40555 Mon Sep 17 00:00:00 2001 From: Andinus Date: Sat, 29 Aug 2020 23:31:08 +0530 Subject: Allow user to select single feeds Now user can run `pyxis timeline ' & it'll only load that feed. --- pyxis.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyxis.pl b/pyxis.pl index 3077281..6f044fb 100755 --- a/pyxis.pl +++ b/pyxis.pl @@ -60,12 +60,19 @@ my %dispatch = ( my $res = $http->mirror($url, $file); $res->{success} ? do {say "$feed updated" if $options{verbose}} - : warn "failed to fetch $feed - $url\n$!\n" + : warn "failed to fetch $feed - $url\n$!\n"; } }, timeline => sub { my %twtxt; - foreach my $feed (path($feeds_dir)->children) { + + # If $ARGV[1] is passed then only load that feed. + my @feeds; + $ARGV[1] + ? push @feeds, "$feeds_dir/$ARGV[1]" + : push @feeds, path($feeds_dir)->children; + + foreach my $feed (@feeds) { for my $line ($feed->lines) { chomp $line; next if (substr($line, 0, 1) eq "#" -- cgit 1.4.1-2-gfad0