-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
concerts
executable file
·40 lines (31 loc) · 892 Bytes
/
concerts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/perl
use strict;
use LWP::Simple;
use HTML::FormatText::Lynx;
use XML::Simple;
use Text::Autoformat qw(autoformat);
my $chop_event = 'http://www.choppevent.se/categories/kalendarium.htm';
my $lucky_you = 'http://www.luckyyou.se/rss_calendar.php';
_chop_event();
_lucky_you();
sub _chop_event {
print HTML::FormatText::Lynx->format_string( get($chop_event) );
}
sub _lucky_you {
my $xml = XMLin( get($lucky_you) );
print '-' x 80, "\n";
print "Lucky You ( http://www.luckyyou.se )\n";
print '-' x 80, "\n";
for my $tag( @{ $xml->{channel}->{item} } ) {
printf("> \e[36;1m%s\e[m\n", $tag->{title});
my $desc = join(' ', split(/\n/, $tag->{description}));
s/ä/ä/g, s/ö/ö/g, s/Ã¥/å/g for $desc; # *grin*
print autoformat($desc,
{
justify => 'left',
left => 4,
right => 72,
},
), "\n";
}
}