Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 11 123 ... LastLast
Results 1 to 10 of 110
  1. #1
    Senior Member mflint's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    392

    Announce: LiveDepartures screensaver plugin

    All,

    This is a screensaver plugin to display running information for UK trains. I use it (along with 'SaverSwitcher') to see whether my trip to the station each morning will be a sprint or a leisurely walk.

    Usage: unzip to the Plugins directory, restart SlimServer. Use the "Server Settings / Plugins" web page to configure the start and destination stations. These need to be the 3-letter station codes. (eg. YRK=York, LDS=Leeds, LIV=Liverpool, SHF=Sheffield)

    (Hint: to find the 3-letter station codes, do a 'live departure' query on the National Rail website. The station codes will be shown in brackets near the names)

    Comments / bugreports welcome.

    Matthew
    Last edited by mflint; 2007-03-25 at 16:57. Reason: Added hint for finding station codes

  2. #2
    Senior Member cparker's Avatar
    Join Date
    Oct 2005
    Location
    Hampshire, United Kingdom
    Posts
    617
    Hi Matthew

    This is a fantastic plugin!

    Some suggestions for improvements;

    How about adding a return option, so that I can see what time my wife is getting home from London. You could have the display cycle between them or even have an option to have the return journey be the primary display say after lunchtime.

    Also if its possible how about a press up and down buttons to see the next train thats coming?

    Anyway, a great plugin, very nice, simple and uncluttered

    Thanks for developing it!

  3. #3
    Senior Member mflint's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    392
    Hey cparker,

    Thanks for the positive feedback! It makes a slightly-p*ssed bloke very happy on a Monday evening...

    How about adding a return option, so that I can see what time my wife is getting home from London. You could have the display cycle between them or even have an option to have the return journey be the primary display say after lunchtime.
    That's a great plan - I like it

    Also if its possible how about a press up and down buttons to see the next train thats coming?
    Yep, it's on the list. "The Law Of Sod" said that I needed that feature this morning, after making the plugin public just 8 hours previously.

    For your info, the other functional item on the list is to make the "destination" station optional, so it shows every arrival/departure from the "start" station.

    M

  4. #4
    Senior Member mflint's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    392
    Okey doke, there's an updated version here, in a hastily-thrown-together wiki thing.

    It'll now show multiple journeys, cycling through them in turn. 10 seconds for the next departure, 5 seconds for the others. Rinse and repeat.

    No config for this yet, just a proof of concept, 'cos my coding after a beer or two ain't that great! ;-)

    M

  5. #5
    Senior Member cparker's Avatar
    Join Date
    Oct 2005
    Location
    Hampshire, United Kingdom
    Posts
    617
    Quote Originally Posted by mflint View Post
    For your info, the other functional item on the list is to make the "destination" station optional, so it shows every arrival/departure from the "start" station.
    M
    Hi Matthew

    Quick one, I removed the destination station to activate the above and it tells me its an invalid entry.

    New value for destStation rejected:
    Invalid value specified:

    Am I doing something wrong??

    Cheers

  6. #6
    Senior Member mflint's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    392
    Quote Originally Posted by cparker View Post
    Hi Matthew

    Quick one, I removed the destination station to activate the above and it tells me its an invalid entry.

    New value for destStation rejected:
    Invalid value specified:

    Am I doing something wrong??

    Cheers
    No, it's my bad. I should have made it clearer: that it's on the "TODO" list, not the "DONE" list ;-)

    Will let you know...

    Matthew

  7. #7
    Junior Member
    Join Date
    Aug 2006
    Posts
    5

    Updated LiveDepartures

    Dear Matthew and all,

    I have updated the plugin to
    1 - Use WWW::Mechanize
    2 - report planned departures as well as the next live departure
    3 - Change from reporting departing trains before midday and late in the evening, to reporting arrivals

    This helps my wife know when I will be home and gave me my first taste of plugin development.

    The attached file is a dropin replacement of Matthews LiveDepartures Plugin.pm. Perhaps somebody can help me package this up.

    Jens

  8. #8
    Senior Member mflint's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    392
    Jens...

    That's cool. I'm rather a novice with Perl, so didn't know WWW:Mechanize even existed. (Though I should have guessed!)

    Will take a look over the weekend. It's nice to know folks are interested enough to hack the code! :-) Would you mind me taking your changes and updating the version on my hacked-together webpage...?

    Matthew

  9. #9
    Senior Member ceejay's Avatar
    Join Date
    Apr 2005
    Location
    Worcestershire, UK
    Posts
    2,314
    What a brilliant piece of work! I've just tried the v1.1 and it works well. I did try Jens' patched version and for some reason it didn't start.

    Here's my enhancement request (have to admit I've no idea if its feasible) ... I'd like to be able to specify more than one start/destination pair, and to be able to select which is active from the remote.

    This would handily cover A to B as well as B to A (the morning/evening thing, although a neat idea, doesn't work for me) and A to C, D to E etc etc. A to B and A to C would certainly get used in my house...

    I suppose one way might be to assign each pair a number from 0 to 9 and switch using the keypad.....

    Many thanks for this already!

    Ceejay

  10. #10
    Senior Member mflint's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    392
    @Jens:

    It's good, but does display a lot of information. I wonder if this could be an option to turn on in the settings? (Or the simpler version could be an option to turn on!) We'd have to put a longer delay into the journey-switching too, as I can't read it fast enough...

    I really do like the improvements you've made to the HTML parsing. Regular expressions are good at what they do, but I can never debug them if I've slept since writing them!


    @Ceejay:

    Thanks for the kind words

    With Jens' version, starting SlimServer in debug mode gave me the error "Can't locate WWW/Mechanize.pm".

    (To fix this, I installed the Ubuntu package "libwww-mechanize-perl")

    I'm torn; Mechanise, at a glance, will make the thing much easier to maintain, but do we force folks to install extra libraries? I'd be interested to hear people's views on this.

    ----

    Re: your enhancement request for extending the number of possible journeys: yes, I've wondered about that. I've also wondered about having journeys set per squeezebox too.

    But how to switch between them? To use the digits would probably conflict with the SaverSwitcher plugin. Could use up/down, I suppose, to switch...

    (Aside: I use SaverSwitcher in its manual mode: pressing 1 displays DateTime, 2 gives LiveDepartures, 3 gives GoalRush, 4 gives TimeSpeller. I don't want or need LiveDepartures to be running full time)

    This might lead to a wider discussion about the direction of ScreenSavers - whether we need to extend the Saver API somewhat, or come up with something new for this type of application: it's clear that people are now using their Slim devices as 'information gathering' devices. I'm not totally convinced that the ScreenSaver route is the best suited device for stuff like LiveDepartures...

    Matthew

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •