|
|
@ -205,8 +205,14 @@ my $state = load_state ($opts{state}); |
|
|
|
my $ua = LWP::UserAgent->new; |
|
|
|
my $ua = LWP::UserAgent->new; |
|
|
|
$ua->agent("twatch-lite/$VERSION"); |
|
|
|
$ua->agent("twatch-lite/$VERSION"); |
|
|
|
$ua->show_progress(1) if $opts{verbose}; |
|
|
|
$ua->show_progress(1) if $opts{verbose}; |
|
|
|
$ua->env_proxy; |
|
|
|
if ($config->{proxy}) { |
|
|
|
# TODO: save cookies? |
|
|
|
$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} }) { |
|
|
|
foreach my $feed (@{ $config->{feeds} }) { |
|
|
|
my $host = $feed->{hostname}; |
|
|
|
my $host = $feed->{hostname}; |
|
|
@ -218,5 +224,6 @@ foreach my $feed (@{ $config->{feeds} }) { |
|
|
|
} |
|
|
|
} |
|
|
|
save_state($opts{state}, $state); |
|
|
|
save_state($opts{state}, $state); |
|
|
|
|
|
|
|
|
|
|
|
# cleanup |
|
|
|
|
|
|
|
exit 0; |
|
|
|
exit 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__END__ |
|
|
|