Henglong has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # RSS CGI Prog use strict; use warnings; use CGI; use XML::RSS; use LWP::Simple; use Data::Dumper; my $url = "http://feeds.feedburner.com/animals"; my $rss_content = get($url); my $rss = XML::RSS->new; my $cgi = CGI->new; my $feed = $rss->parse($rss_content); print $cgi->header, $cgi->start_html(-style=>"/css/cgi_lesson1.css", -title=>"This i +s an RSS Feed Puller!"), $cgi->div({-class=>"header"},"This is a very simple program that + pulls from $url"), "<div class=\"container\"><div class=\"content\">"; #print Dumper($feed); foreach my $feeds (@{$feed}) { print "<p> This is a line break, I hope you like it</p>"; foreach (my $key ( keys %{$feeds})) { print "<p><strong>$key</strong>", $feeds->{$key},"</p>" } } print "</div></div>"; print $cgi->end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trying to get an RSS to display
by Anonymous Monk on Oct 26, 2011 at 16:14 UTC | |
by Henglong (Initiate) on Oct 27, 2011 at 03:50 UTC | |
by Anonymous Monk on Oct 27, 2011 at 04:54 UTC | |
by Henglong (Initiate) on Oct 27, 2011 at 13:37 UTC | |
by Henglong (Initiate) on Oct 27, 2011 at 16:24 UTC | |
by Anonymous Monk on Oct 27, 2011 at 21:20 UTC |