#!/usr/bin/perl -w


use lib "/www/opal/module";;
use Opals::Context('/etc/opals/conf/alp_alp');
use strict;
use Time::HiRes qw( time );
use CGI;
use DBI;
use JSON;
use Digest::SHA qw(
    sha1_hex
);
use Opals::XML::RSS::Parser;
use FileHandle;

my $cgi    = CGI->new;

my $dbh = Opals::Context->dbh();

 
 
 my $p = XML::RSS::Parser->new;
 my $fh = FileHandle->new('https://www.christiancentury.org/taxonomy/term/44172/feed');
 my $feed = $p->parse_file($fh);
 
 # output some values 
 my $feed_title = $feed->query('/channel/title');
 print $feed_title->text_content;
 my $count = $feed->item_count;
 print " ($count)\n";
 foreach my $i ( $feed->query('//item') ) { 
     my $node = $i->query('title');
     print '  '.$node->text_content;
     print "\n"; 
 }
