История изменений
Исправление saahriktu, (текущая версия) :
Так ещё лучше:
#!/usr/bin/perl
use LWP::Simple;
use XML::Simple;
@rssxmlfiles = ('dwd.xml', 'dwp.xml');
foreach $nextxmlfile (@rssxmlfiles){
my $url = "http://distrowatch.com/news/" . $nextxmlfile;
my $content = get $url;
die "Couldn't get $url" unless defined $content;
my $xmlcontent = XMLin($content,);
print "$xmlcontent->{channel}->{title} \n";
for (@{$xmlcontent->{channel}{item}}) {
print "$_->{title} \n";
}
}
> ./distrowatchrss2.pl
DistroWatch.com: Distributions
11/23 FreeNAS 10-BETA2
11/22 Fedora 25
11/22 Clonezilla 2.5.0-5
11/20 NAS4Free 11.0.0.4
11/20 Antergos 2016.11.20
11/19 Manjaro 16.10.2
11/19 ArchBang 1116-beta "Lite"
11/19 4MLinux 21.0
11/18 LinHES 8.4.2
11/18 Zorin 12
11/18 Tails 3.0-alpha1
11/17 NethServer 7.2-rc2
DistroWatch.com: Packages
11/23 devede 4.8.5
11/23 cinnamon 3.2.2
11/22 plasma-desktop 5.8.4
11/21 lxde-common 0.99.2
11/21 VirtualBox 5.1.10
11/21 ruby 2.3.3
11/21 linux 4.8.10
11/19 avidemux 2.6.15
11/18 gtk+ 3.22.4
11/18 gnupg 2.1.16
11/18 NVIDIA 375.20
11/18 thunderbird 45.5.0
Исходная версия saahriktu, :
Так ещё лучше:
#!/usr/bin/perl
use LWP::Simple;
use XML::Simple;
use Data::Dumper;
@rssxmlfiles = ('dwd.xml', 'dwp.xml');
foreach $nextxmlfile (@rssxmlfiles){
my $url = "http://distrowatch.com/news/" . $nextxmlfile;
my $content = get $url;
die "Couldn't get $url" unless defined $content;
my $xmlcontent = XMLin($content,);
print "$xmlcontent->{channel}->{title} \n";
for (@{$xmlcontent->{channel}{item}}) {
print "$_->{title} \n";
}
}
> ./distrowatchrss2.pl
DistroWatch.com: Distributions
11/23 FreeNAS 10-BETA2
11/22 Fedora 25
11/22 Clonezilla 2.5.0-5
11/20 NAS4Free 11.0.0.4
11/20 Antergos 2016.11.20
11/19 Manjaro 16.10.2
11/19 ArchBang 1116-beta "Lite"
11/19 4MLinux 21.0
11/18 LinHES 8.4.2
11/18 Zorin 12
11/18 Tails 3.0-alpha1
11/17 NethServer 7.2-rc2
DistroWatch.com: Packages
11/23 devede 4.8.5
11/23 cinnamon 3.2.2
11/22 plasma-desktop 5.8.4
11/21 lxde-common 0.99.2
11/21 VirtualBox 5.1.10
11/21 ruby 2.3.3
11/21 linux 4.8.10
11/19 avidemux 2.6.15
11/18 gtk+ 3.22.4
11/18 gnupg 2.1.16
11/18 NVIDIA 375.20
11/18 thunderbird 45.5.0