[mythtv-users] Having fun with OSD

Brad DerManouelian myth at dermanouelian.com
Sun Dec 18 22:03:17 EST 2005


You inspired me. I just wrote this quick script to display my  
MythNews headlines. Anyone know if it's possible to trigger an  
external script while watching TV? I set it to run every hour, but  
I'd much prefer it to run when I hit a button on my remote and feel  
like being depressed.

Use/modify it if you like.

#!/usr/bin/perl -w
use strict;
use LWP::Simple;
use XML::RSS;
use DBI;

my $dbh = DBI->connect('dbi:mysql:mythconverg','mythtv','mythtv');
my $sql = "SELECT url FROM newssites ORDER BY updated DESC";
my $sth = $dbh->prepare( $sql );

$sth->execute || die ('Could not execute SQL statement: $sql');

my $sNews;
while ( my $row = $sth->fetchrow )
{
     my $rss = new XML::RSS;
     $rss->parse( get( $row ) );
     foreach my $item (@{$rss->{'items'}})
     {
         $sNews .= "$item->{'title'} - $item-> 
{'description'}          ";
     }
}

`mythtvosd --template=scroller scroll_text="$sNews"`;




On Dec 18, 2005, at 5:56 PM, Sasha Z wrote:

> ...and so how do you enforce that? But that is a funny idea. Kudos!
>
> On 12/18/05, Support [ Ian Ward ] <support at cyberpro.com.au> wrote:
>> I thought I would share the mythtv user's crontab with the list.
>> Open Source is even good for parenting ;-)
>>
>> 0 21 * * * /usr/bin/mythtvosd --template=alert alert_text="Jessica or
>> Tegan, who is doing the wash up??"
>> 20 21 * * 0-4 /usr/bin/mythtvosd --template=alert alert_text="!!!  
>> Time
>> for BED !!!"
>>
>> Ian
>> _______________________________________________
>> mythtv-users mailing list
>> mythtv-users at mythtv.org
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>



More information about the mythtv-users mailing list