diff --git a/twatch-lite b/twatch-lite index 406baf0..2167520 100755 --- a/twatch-lite +++ b/twatch-lite @@ -205,8 +205,14 @@ my $state = load_state ($opts{state}); my $ua = LWP::UserAgent->new; $ua->agent("twatch-lite/$VERSION"); $ua->show_progress(1) if $opts{verbose}; -$ua->env_proxy; -# TODO: save cookies? +if ($config->{proxy}) { + $ua->proxy(['http', 'https'], $config->{proxy}); +} else { + $ua->env_proxy; +} +if ($config->{cookies}) { + $ua->cookie_jar({ file => "$ENV{HOME}/.config/twatch-lite/cookies.txt" }); +} foreach my $feed (@{ $config->{feeds} }) { my $host = $feed->{hostname}; @@ -218,5 +224,6 @@ foreach my $feed (@{ $config->{feeds} }) { } save_state($opts{state}, $state); -# cleanup exit 0; + +__END__