RSS Feed is a way to check for updates to your favorite websites, without having to visit each site individually. This sample demonstrates how the scripting languages can be used to screen scrape information from a website. The automated IVR is introduced to fetch the RSS feed, and play back the information to the caller.
Download the evaluation version of Xtend IVR and install the telephony application in your system. Run the sample script from the Script Editor. Click here to refer the code.
The automated attendant will work as given below:
MAIN: answer $RSSFeed = "http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml" SPEAK_FEED: speak "Welcome to R. S. S. feed reader." speak "please wait while we fetch your R. S. S. Feed." wait 0 play "music.wav" play "music.wav" play "music.wav" play "music.wav" $Status = GetRss($RSSFeed) clear if $Status == 0 speak "Unable to fetch the R. S. S. feed you have specified" goto BYE endif if len($RSS.Title) > 0 FlashBox("TOPRIGHT",concat(chr(10),"The title of the R. S. S. Feed is ", $RSS.Title,chr(10))) speak "The title of the R. S. S. Feed is " $RSS.Title else speak "The R S S feed does not have a title" endif speak "Total number of items in this feed is" $RSS.ItemCount wait 0 $Count = 1 while $Count <= $RSS.ItemCount play "silence.wav" speak "Item " $count play "silence.wav" $Heading = concat("$RSS.", $Count, ".Title") $Heading = $$Heading FlashBox("TOPRIGHT",concat(chr(10),$Heading,chr(10))) speak $Heading wait 0 play "silence.wav" $Description = concat("$RSS.", $Count, ".Description") $Description = $$Description FlashBox("TOPRIGHT",concat(chr(10),$Description,chr(10))) speak $Description wait 0 $Count += 1 endwhile BYE: speak "Thank you for calling Feeds Cast Dot Com" FlashBox() hangup goto MAIN ONHANGUP: FlashBox() hangup goto MAIN ONSYSTEMERROR: log $error display $error hangup goto MAIN