-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
47 lines (33 loc) · 1.15 KB
/
index.html
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
41
42
43
44
45
46
47
<& /shared/podcast.mhtml,
title => $data->{channel}->{title},
description => $data->{channel}->{description},
category => 'wfmu',
summary => $data->{channel}->{description},
items => $items
&>
<%init>
use LWP::Simple;
use XML::Simple;
my $show = $ENV{QUERY_STRING};
unless ($show =~ /^\w\w$/) {
die "Not a valid WFMU show code (two letters).";
# If the user uses a show code that is two letters long but not a valid
# WFMU show code, we'll die anyway with a 500 error of some kind
}
my $data = XMLin(get("http://wfmu.org/archivefeed/mp3/$show.xml"));
my $items = $data->{channel}->{item};
foreach (@$items) {
# WFMU doesn't publish a direct link to the archived mp3 in their archive
# RSS; instead they publish a URL whose content, when retrieved, is the URL
# of the mp3 file (plus a bogus newline); so, we go get it and insert it into
# the item.
my $mp3url = get($_->{link});
chomp $mp3url;
$_->{link} = $mp3url;
}
</%init>
<%doc>
wfmucast, version 1.0
Copyright 2008 Dan Friedman. This component is free software; you can
redistribute it and/or modify it under the same terms as Perl itself.
</%doc>