The city I live in, Trondheim, has a few webcams. The harbor operates a few of them, including this one: http://trondheimhavn.no/hurtigrutekaia-webkamera.aspx
This camera is pointed towards a pier called “Hurtigrutekaia”, and is where the ships in the “Hurtigruta”-franchise docks. These are combined passanger and cargo boats, and travel up and down the coast of Norway all year long. From Bergen in the south, to Kirkenes in the north. More about that here.
In addition, this pier is about 100m from where I work. So I see these ships every day.
But back to the technical stuff. I wanted to take this picture, and use it as my header. It’s not the best quality I’ve seen (…) but it makes things a bit more interesting. So I made myself a small tiny shell-script. And since my host didn’t have neither ImageMagick nor GraphicsMagick, the script actually runs on my ReadyNAS-box at home and then pushes the image to the webhost from there.
rm cam4_image.jpg cropped.jpg
gm convert -crop 1000x288+105+206 cam4_image.jpg cropped.jpg
sshpass -p 'mypassword' scp cropped.jpg username@hostname:~/public_html/wattengard.no/cropped.jpg
I know, I know. I should setup ssh keys and whatnot. No one has died yet. The NSA can see everything anyway, right?
Anyway. This works exactly as I had planned. And this little thing now runs in a cronjob every 30 minutes. And hence, my header image is dynamic and alive!!! *cough*
Until next time… Christian out!