#!/usr/bin/perl -w # headlines-AGI.pl - by dual # # Reads the latest headlines # on your Asterisk box ############################ use strict; use LWP::UserAgent; use Asterisk::AGI; # Feed location my $url = 'http://www.thenewmexicochannel.com/news/topstory.rss'; # Create AGI object my $AGI = new Asterisk::AGI; # Placate caller $AGI->exec('AGI',"festival-script.pl|\"Please wait while I get the latest news.\""); # Grab the content and check status my $browser = LWP::UserAgent->new(); my $feed = $browser->get($url); die $feed->status_line . "\n" unless $feed->is_success; # Read in feed content my $content = $feed->content; # Read the latest headlines $AGI->exec('AGI',"festival-script.pl|\"Here are the headlines.\""); while ($content =~ /