I'm (very!) new to Perl so please bear with me if any of the code looks wrong or long-winded, but I've written the attached simple plugin which acts as a screensaver to display the latest football scores from Europe, using the sportinglife.com website. I've been using it for a few weeks now and it seems to work well so I thought I'd share it.
Please let me know if you find any bugs, have any comments, or have any ideas for improvement.
(Thanks to M. Herger for his original Fileviewer plugin - basically I butchered it to produce this plugin !)
Cheers
John
John Entwistle
Results 1 to 8 of 8
-
2006-11-10, 08:57 #1Junior Member
- Join Date
- Jun 2006
- Location
- Bolton, UK
- Posts
- 11
European Football (soccer) scores plugin
-
2006-11-10, 13:01 #2
Since I'm a footyfan I really like this idea!
Actually, I'm looking for RSS-feeds with live scores (specifically for spanish La Liga, Champions League etc) to the RSS plugin but so far I havn't found any. This is where I see the potential of this plugin.
From a first glance, I'd like it to revert to the RSS plugin (if it is available) instead of the currently hardcoded BBC feed.
I'll try it out and get back with some more feedback!
ADDED//
I installed it in the root of the Plugins folder and restarted my SlimServer.
When I activated it as a Screensaver (by using the SB remote: Settings->Screensavers->"Screensaver when stopped"...) I noticed that the name of the plugin was missing/blank when browsing through the available Screensavers (I could still set it, though).
Since my SlimServer runs with swedish locale I then tried editing the Football.pm and added a "SE Fotbollresultat"-string. (New restart of the SlimServer)
The name was still missing but I activated it anyway and waited for the screensaver to start:
- Unfortunately I only got the BBC feed and not the scores, which were available if I put the hardcoded > link < in my browser instead.
Note: if I enter the SlimServer and set the Plugin from there, I can see the translated "Fotbollsresultat"-string, likewise in the SB when looking at the "Plugins -> Screensavers -> "Fotbollsresultat", so it seems it's a separate string when activating it?!
Also, I noted that I can only revert to the SB menu by shutting the SB off and on with the remote. This is tested with "screensaver to use when not playing"-mode.
(My testenvironment: SlimServer 6.5.1 running on Linux, Firmware#67 on the SB3)
... any ideas?
//
CheersLast edited by dc11ab; 2006-11-11 at 02:26. Reason: Added test result
-
2006-11-11, 07:05 #3Junior Member
- Join Date
- Jun 2006
- Location
- Bolton, UK
- Posts
- 11
You'll only get an update if there has been one in the last 10 mins - otherwise it will display the BBC headline. Give it a go this afternoon and it should be displaying constant updates.
Not sure about the other things - like I said I'm only a newbie and I only display this plugin when the squeezebox is turned off.
-
2006-11-12, 01:32 #4
Well I'm a newbie myself. Trial and error (especially the latter
is my game when it comes to scripts, installations and so on...
- I'll try testing the Football.pm this Sunday afternoon with parameters as close to yours as possible.
What SlimServer version do you run?
Cheers
-
2006-11-12, 09:52 #5
After some testing and tweaking I still only get BBC feed only :/
Checking the site where the updates come from in a browser tells me that there is actually a score feed available, but it just doesn't seem to enter the plugin...
Noted your test environment in the Football.pm code.
I run SS6.5.1 on Linux, I assume you run your SlimServer on a Windows box; Perhaps this is why I get a lot of ^M's at the end of each line feed in your Football.pm file?
I tried the following tweaks, unsuccessully
I removed all the ^M's
I changed the
use Slim::Utils::Strings qw (string);
to
use Slim::Utils::Strings qw(string);
I changed
sub strings { return q^
PLUGIN_FOOTBALL
DE Dateibetrachter
EN Football
^;
}
to
sub strings { return '
PLUGIN_FOOTBALL
DE Dateibetrachter
EN Football
';
}
But as said, no luck with that :/
I'll carry on another day with more tests. With a stroke of luck someone with a lot better Perl skills could enlighten us of what could be the issue. But now it's time to watch some real football on the TV
Cheers
-
2006-11-13, 06:33 #6Senior Member
- Join Date
- Feb 2006
- Location
- London,UK
- Posts
- 105
European Football (soccer) scores plugin
Hi John,
Nice work! I've used your plugin on suse linux 10.1 & slim 6.50 & it works
as described. Only thing I notices was a bit weird, it abbreviated
premiership teams names but not some others. (didn't look for long
yesterday, but some teams abbreviated some not)
I'd like to revamp my cricket plugin for the upcoming ashes tour & lift some
of you code if I may. Like yourself I was a newbie when I wrote my plugin &
borrowed some code then. Not much more perl since then so I see how far I
get.
If you like I send you a first draft when I get something together, its a
bit difficult to test without bbc invision cricket scores, but I'll see
what I can do.
message for dc11ab,
^M at the start of lines indicates an endof line conversion problem. Maybe
a windows/linux thing. Way I get plugins is to download to my windows
laptop, then ftp to my linux server (or download id direct to your linux
box) Check owner is slimserver user & you can double check by opening your
plugin with your favourite command line editor (eg vi or emacs). Shouldn't
see any ^M then.
-
2006-11-13, 10:18 #7Junior Member
- Join Date
- Jun 2006
- Location
- Bolton, UK
- Posts
- 11
Waldy yes that's fine - everyone borrowing each other's code is how these things advance
I've noticed the abbreviation anomaly too - I'll do a bit of testing this week sometime.
Yes please send the draft - I suppose the best test will be the first Ashes test, although that may be grim viewing
John
-
2006-11-13, 13:26 #8
I use Firefox on my WinXP client to download the Football.pm directly to a share on my Synology NAS, which runs on a Busybox Linux.
Directly after downloading I open PuTTY and use vi to view/edit the file - it still gives me those EoF ^M's at each line! From what I assume I havn't touched the file from Windows.
The odd thing is that I use the same procedure with all the other plugins and have successfully installed them (WeatherTime, WebLogger etc) - but this one simply does not work for me
Someone please help a desperate newbie!

Reply With Quote
