the new earthpeople.se is an experiment driven website, where we try out ideas in the background, where the actual content stays the same over time. we just love fiddling around with www, and we thought it would be a good idea to showcase this somehow.
the base of the website is a codeigniter install, with all content living inside one reusable model. using routes we can decide when to go live with a new experiments, by routing to a new controller.
in the first experiment we’ve set up a webcam, which will move around from day to day. our music machine (my old macbook pro) has been rigged with a couple of scripts to enable twitter users to decide our playlist. the playlists are logged in mysql and displayed on the website.
some fun findings when creating these scripts were:
- you can control the local spotify client by calling “open <spotify uri>” from commandline (at least in osx).
- it’s easy to make your mac talk, from php. call “say <text to be spoken>” from within a system() call (we use this to make the mac read us whatever is playing next and who’s chosen it)
- spotify’s metadata api returns the duration of a song, which makes it easy to create a fake play queue from within php. the script playing songs is actually just an endless loop that sleep()’s the duration of the current song.
download the scripts here. bare in mind that these are just fun hacks and should maybe not be used in a production environment. oh wait…Tweet