[mythtv-users] Having fun with OSD
Brad DerManouelian
myth at dermanouelian.com
Fri Dec 23 07:20:53 EST 2005
http://efilmcritic.com/fo.rdf looks to be the culprit. They don't use
a description element that the script is looking for. Here's my "I
just woke up and don't feel like testing it" hack. Looks like it
should work..
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
use XML::RSS;
use DBI;
use HTML::Entities ();
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'}" if ( $item->{'title'} );
$sNews .= " - $item->{'description'}" if ( $item->
{'description'} );
$sNews .= " " if ( $item->{'title'} && $item->
{'description'} );
}
}
$sNews = HTML::Entities::encode($sNews);
`mythtvosd --template=scroller scroll_text="$sNews"`;
On Dec 22, 2005, at 11:47 PM, Phill Edwards wrote:
> On 23/12/05, Brad DerManouelian <myth at dermanouelian.com> wrote:
>> Do you have the URL to the feed causing the error? It's more likely
>> that the RSS feed doesn't conform to the standard than your library
>> being wonky.
>
> The URLs returned by the query are as below. I'll go through them one
> at a time and try to find the culprit. I'll probably want to filter
> the query anyway as this would scroll for hours so thanks for the
> pointer!
>
> | http://news.zdnet.com/
> 2260-1_22.xml |
> | http://efilmcritic.com/
> fo.rdf |
> | http://newsrss.bbc.co.uk//rss/newsonline_uk_edition/technology/
> rss.xml |
> | http://blogs.zdnet.com/BTL/wp-
> rss2.php |
> | http://rssnewsapps.ziffdavis.com/
> pcmag.xml |
> | http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/
> rss.xml |
> | http://rss.topix.net/rss/world/
> australia.xml |
> | http://rss.cnn.com/rss/
> cnn_offbeat.rss |
> | http://rss.topix.net/rss/news/
> weird.xml |
> | http://dwlt.net/tapestry/
> dilbert.rdf |
> | http://newsrss.bbc.co.uk/rss/newsonline_world_edition/science/
> nature/rss.xml |
> | http://rss.cnn.com/rss/
> cnn_tech.rss |
> | http://abc.net.au/news/syndicate/
> topstoriesrss.xml |
> | http://abc.net.au/news/syndicate/
> breakingrss.xml |
> | http://abc.net.au/news/syndicate/
> worldrss.xml |
> | http://abc.net.au/news/syndicate/
> entertainmentrss.xml |
> | http://abc.net.au/news/syndicate/
> businessrss.xml |
> | http://abc.net.au/news/syndicate/
> ruralrss.xml |
> | http://abc.net.au/sport/syndicate/
> sport_all.xml |
> | http://abc.net.au/sport/syndicate/
> rugby_union.xml |
> | http://abc.net.au/sport/syndicate/
> cricket.xml |
> | http://abc.net.au/sport/syndicate/
> soccer.xml |
> | http://abc.net.au/sport/syndicate/
> rugby_league.xml |
> | http://abc.net.au/sport/syndicate/
> afl.xml |
> | http://abc.net.au/news/syndicate/
> offbeatrss.xml |
> | http://abc.net.au/news/syndicate/
> sciencerss.xml |
> | http://abc.net.au/news/syndicate/
> healthrss.xml |
> | http://abc.net.au/news/syndicate/
> politicsrss.xml |
> | http://mail.google.com/mail//feed/atom
>
> Regards,
> Phill
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20051223/685a608f/attachment.htm
More information about the mythtv-users
mailing list