[$ # display selected channel use URI::Escape; my @channels = get_my_sorted_channels("date_downloaded", "reversed_data"); # get the user's window target preference (which controls # whether links should open up in the current or a new window. my $link_target = get_setting( "user_link_target" ); # for each channel, parse and display. foreach my $channel (@channels) { # skip unless this is the right channel next unless ( uc($channel->{xmlurl}) eq uc(get_setting( "user_af_currentfeed_xmlurl" )) ); # and then load all the channel data. (Note that it's possible there isn't any data.) my $data = load_channel($channel->{filename}, $channel->{xmlurl}); next unless $data; # Only display channel data if it's there. Otherwise show message if ($channel->{date_downloaded} || $data) { # if there are no channel items, say so. if ( not defined($data->{item}) or scalar @{$data->{item}} <= 0) { to_browser(qq{

This channel has no items that AmphetaDesk can display.

\n}); } # each of the channel items. foreach my $item (@{$data->{item}}) { # check to see if mod_content is used, which is a module to RSS 1.0 # allowing more data in a feed as well as embedded HTML. this is NOT # a full implementation, as it'll only support CDATA's. if it does # exist, then we stick the data into our $item->{description}. my $rdf_value = $item->{"content:items"}{"rdf:Bag"}{"rdf:li"}{"content:item"}{"rdf:value"} if defined($item->{"content:items"}{"rdf:Bag"}{"rdf:li"}{"content:item"}{"rdf:value"}); $item->{description} = $rdf_value if defined($rdf_value); # display the actual item. to_browser(qq{

\n}); to_browser(qq{ \n}) if $item->{link}; to_browser(qq{ $item->{title} \n}) if $item->{title}; to_browser(qq{ \n}) if $item->{link}; to_browser(qq{

\n}); to_browser(qq{
\n}); to_browser(qq{ $item->{description} \n}) if $item->{description}; to_browser(qq{
\n}); } } else { to_browser(qq{

There is no available content for this feed.

\n}); } } $OUT = send_to_browser; $]