[mythtv-users] Having fun with OSD

Graeme Hilton graeme.hilton at fishter.org.uk
Tue Dec 20 06:48:01 EST 2005


Thanks for the script Brad.

Here's a modification so that it doesn't bomb on odd characters:

Add after use DBI;
use HTML::Entities ();

and just before the last line, add

$sNews = HTML::Entities::encode($sNews);

Cheers,

-- 
Graeme Hilton


On Mon, 19 December, 2005 3:03 am, Brad DerManouelian wrote:
> 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 !!!"

-- 
Graeme Hilton


More information about the mythtv-users mailing list