dotfiles

My dotfiles, nothing really interesting to see ...
git clone https://git.onna.be/dotfiles.git
Log | Files | Refs | README

commit 777b73c3f26940a693b4cf9e332dd61461c05b7b
parent 06a19aaca934f218abeba2968ea9bbe5b053c592
Author: Paco Esteban <paco@onna.be>
Date:   Tue, 23 Oct 2018 09:34:18 +0200

now we can list/search for main categories on rarbg

Diffstat:
bin/bin/rarbg.pl | 22+++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/bin/bin/rarbg.pl b/bin/bin/rarbg.pl @@ -6,7 +6,7 @@ use warnings; use lib "$ENV{HOME}/src/perl5/lib/perl5"; use Rarbg::torrentapi; use Getopt::Long; -use Data::Dumper; +no warnings 'experimental'; sub usage { say "Usage: $0 [--list] [--search <string>] [--categories <movies|tv>]"; @@ -23,14 +23,30 @@ my $counter = 0; my $search = ""; my $list; my $result; -my $category = 'movies'; +my $raw_category = ''; +my $category; GetOptions( "search=s" => \$search, "list" => \$list, - "category=s" => \$category + "category=s" => \$raw_category ) or usage(); +given ($raw_category) { + when ( $_ eq 'movies' or $_ eq 'tv' ) { + $category = $raw_category; + } + when ( $_ eq 'music' ) { + $category = '2;23;24;25;26'; + } + when ( $_ eq 'xxx' ) { + $category = '2;4'; + } + default { + $category = 'movies' + } +} + if ($search) { $result = $tapi->search( { sort => 'seeders',