Let’s take a look at the hardware first. He acquired a 7″ LCD display which he removed from its plastic case. The bare screen will easily fit inside of the rather deep wood frame and its composite video input makes it quite simple to interface with the RPi board. There was a little work to be done for power. The LCD needs 12V so he’s using a 12V wall wart to feed the frame, and including a USB car charger to power the RPi. The last thing he added is a button connected to the GPIO header to tell the system to fetch a new set of times.

A Python script monitors the button and uses Beautiful Soup to scrape the train info off of a website. To get the look he wanted [Gareth] wrote a GUI using tkinter. Don’t miss the demo after the jump.

22 thoughts on “Picture frame that scrapes train times from the web”

Raspberry Pi seem to me to be a really good fit for some rendering and a little bit of web scraping. I don’t see how you could do that cheaper in a stand alone device (in new parts) without going to ridiculous lengths. Rpi + memory card is like $40-50 (shipped), hardly a problem for most westerners with a day job and no kids, well worth the convenience for many.

Very nicely done. You say in the post that you scrape the data from one of the live train times sites. Network Rail have recently released their data for free – though you do have to sign up for it, and it isn’t perhaps as easy to digest as a screen scrape – might be worth a look though:

It’s a sweet project, though I agree that raspberry pi is probably overkill. Pulling the data through Yahoo Pipes or running his python script through something like scraperwiki would have made more sense.

This still leaves the question how you get your information to this kind of LCD panel. I don’t know how much time it would take me to build a system which converts plain text to e.g. a good looking VGA signal. Before there was the pi, I would probably thought about gutting an old laptop.

Hove is on the Brighton to Portsmouth / Littlehampton west coast (most is in West Sussex) line, and while there are trains from Hove direct to London (on the Littlehampton to London Victoria route), they are hourly (or where, when I lived in the area until 1989) during the day, so it can be quicker to go via Brighton.