August 2005
Beginner
464 pages
12h 36m
English
Combine a bunch of feeds to make your own broadcast network.
Podcasting is like TiVo: you set up your subscriptions and get the shows you want as they come out. But what happens when you want to take your subscriptions on the road, or share them with your friends? This script allows you to create a single feed that pulls the most recent podcast from each feed you specify.
Save the following code as network.pl:
#!/usr/bin/perl -w use LWP::Simple; use strict; # The list of feeds to retrievemy @feeds = qw(http://www.curry.com/xml/rss.xml http://www.boundcast.com/index.xml);# The title of the network feedmy $networkName = "# The URL of the home pageMy Network";my $url = "# A description of your networkhttp://www.mysite.com";my $description = "# Format the current date and time my @days = qw( Sun Mon Tue Wed Thu Fri Sat ); my @months = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); my @t = gmtime( time ); my $date = sprintf( "%s, %d %s %d %02d:%02d:%02d GMT", $days[ $t[6] ], $t[3], $months[ $t[4] ], $t[5] + 1900, $t[2], $t[1], $t[0] ); # Print the header portion of the RSS 2.0 print <<END; Content-type: text/xml <?xml version="1.0"?> <rss version="2.0"> <channel> <title>$networkName</title> <link>$url</link> <description>$description</description> <language>en-us</language> <pubDate>$date</pubDate> <lastBuildDate>$date</lastBuildDate> <generator>Network 1.0</generator> END # Iterate through each feed and find ...My very own network";
Read now
Unlock full access