[mythtv-users] Having fun with OSD

Phill Edwards philledwards at gmail.com
Wed Dec 21 04:07:14 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"`;

Thanks Brad. I tried it but when I do a test run from the command line
I get these errors:

<snip>
.....
Use of uninitialized value in exists at
/usr/lib/perl5/vendor_perl/5.8.5/XML/RSS.pm line 1432.
Use of uninitialized value in exists at
/usr/lib/perl5/vendor_perl/5.8.5/XML/RSS.pm line 1432.
Use of uninitialized value in exists at
/usr/lib/perl5/vendor_perl/5.8.5/XML/RSS.pm line 1432.
Use of uninitialized value in exists at
/usr/lib/perl5/vendor_perl/5.8.5/XML/RSS.pm line 1432.
Use of uninitialized value in exists at
/usr/lib/perl5/vendor_perl/5.8.5/XML/RSS.pm line 1432.
Use of uninitialized value in subroutine entry at
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/XML/Parser/Expat.pm
line 474.

no element found at line 1, column 0, byte -1 at
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/XML/Parser.pm
line 187
</snip>

I'm running FC3 with RPMs from ATrpms. Any ideas, anyone, why it would
be giving these errors?

Regards,
Phill


More information about the mythtv-users mailing list