TechCrunch – VoiceRSS January 19, 2009

For the readers of TechCrunch, here is a simple way to stay informed about new posts. Just click on the widget below and new posts will be read out to you.

Try It Now!

Click the button below or call +15672449719 to run the application.

Embedding this widget is very simple too. Just cut and paste this code on your website.

<div id=”tringme99219″>
<script type=”text/javascript” src=”http://login.tringme.com/widget.php?channel=tf4e6tas8v5c8n26be7axd3w461c4e&username=TechCrunch+Feeds&wtype=1&divid=tringme99219&beta=1“>
</script>
</div>

Here is the code behind the scenes that makes it all possible.

<?php
include_once ("rssutils.php");

echo 
"Welcome to Voice PHP RSS Reader demonstration.";
speak_rss('Tech Crunch''http://feedproxy.google.com/Techcrunch');
echo 
"Thank you for trying Voice PHP.";

// A simple function which speaks the RSS feeds
function speak_rss ($name$url) {
    
// Get RSS feeds now from the selected feed source using a helper function
    
if (false == get_rss($url51024, &$result)) {    
        return 
false;
    }
    
$loop_count 3;
    while(
$loop_count) {
        
setvoiceoption("voicetype""female");
        echo(
"Reading news feeds from $name. 
              At any time, press 1 to get details on the feed, 
              press 3 to exit."
);
                
        for(
$count=0$count count($result); $count++) {

            
$choice '';
            
$voicetype = ($count&1)?"female":"male";
            
setvoiceoption("voicetype"$voicetype);
            
            
$choice prompt($result[$count]['title'], 11"dtmf:1");

            if(
$choice == '1'
                
$choice prompt($result[$count]['description'], 11"dtmf:1");
                
            if(
$choice == '3'
                return;                
        }                
        
sleep(1);
        
$loop_count--;
    }
// End of function speak_rss

?>

Download source code

Does'nt it look easy? Try VoicePHP for yourself and feel free to modify the above script. VoicePHP is easy and accessible from your free TringMe account. More details at http://voicephp.com/howitworks.html

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© Copyright TringMe., All rights reserved. - Blog powered by Wordpress - Designed by Speckyboy