Tag Archives: Ruby

A script to download 4oD

Anyone living in the UK will be familiar with the superb video on demand service run by Channel4; while it does have years worth of programmes, it doesn’t have an option to view the content without an internet connection. This is particularly frustrating as my TV doesn’t have an internet connection, although it does have support for USB mass storage devices. To work around this, I’ve written a ruby script that downloads 4oD videos to local MPEG-4 files. Continue reading

Updating my youtube music player

Recently the youtube search results page changed slightly; this caused my youtube music player to stop working properly. I’ve rewritten parts of it; not only to work with the new youtube search, but I’ve also taken the opportunity to improve a few other areas.

The biggest change is the integration of an automatic pause feature based on bluetooth proximity sensing. If a bluetooth device’s MAC address is entered, the music will automatically pause when that device leaves visible range; once it returns, the music will resume automatically. I have also added the ability to use 3 basic commands at the search prompt: /skip /pause and /play; they do exactly what you’d expect. Continue reading

Pausing Banshee using bluetooth proximity

In my continued efforts to control everything with bluetooth proximity, I’ve successfully nailed another target: Banshee media player. Banshee is the default media player supplied with Ubuntu and has some surprisingly useful command line arguments that allow it to be controlled from ruby scripts. I’ve written one that pauses banshee if I leave the room while something is playing and then resumes where it left off as I re-enter the room. Continue reading

Using text to speech to announce new emails on arrival home

I’ve done some more tinkering with bluetooth proximity detection and have succeeded in making my life slightly more like a science fiction film. When I arrive home, my computer uses text to speech to greet me and tell me if I’ve got any new emails. This reuses the code from last week to detect the presence of my phone via bluetooth, with the slight alteration of tracking what the previous state was. We only want to trigger the announcement when the phone returns to the room, not the whole time the phone is in the room. Continue reading

Controlling the mains with bluetooth proximity

I’ve found another use for my parallel port controlled socket box; by using it in conjunction with a bluetooth dongle, I can detect when I have wandered out of the room. I can turn off a load of peripherals, then turn them all back on when I return to the room seamlessly. I’ve simply plugged the extension leads which power my monitors, speakers, kettle, lamps and fan into the parallel controlled socket then let a ruby script act as the brains of the operation. Continue reading

Controlling a fan with live weather updates

Spring has arrived, this means rooms get uncomfortably hot. A fan helps, but manually turning a fan on and off doesn’t work when I’m asleep or out. This results in waking up or arriving home to a sweltering room. I’ve written a little ruby script that puts Controlling the mains via the parallel port with data from a weather station in Southampton that publishes the weather live. Continue reading

Playing youtube music from the command line

Record collections certainly used to be nice, but sometimes it’s much nicer to have every song you can possibly think of at your fingertips. Youtube is a good source, but has several things holding it back; most significantly ads, playlists that don’t function as on-the-fly play queues and it cannot easily be operated remotely over ssh. Remote ssh control is useful because I’m often sat in a room with both my netbook and another computer with much better sounding speakers. I’ve overcome these problems by writing a ruby script. Continue reading