Science Hack Day

Didn’t know what time it was and the lights were low
I leaned back on my radio
Some cat was layin’ down some rock ’n’ roll ’lotta soul, he said
Then the loud sound did seem to fade
Came back like a slow voice on a wave of phase
That weren’t no D.J. that was hazy cosmic jive

David Bowie, Starman

This past weekend I attended Science Hack Day in San Francisco. I’m afraid of both these things, so this is a big deal. I faced many of my fears this weekend: Fear of being away from home for more than three hours. Fear of the affluence and pressure of San Francisco. Fear of crowds. Fear of hack days. Fear of birds. Fear of talking about front end development. Fear of public speaking. Fear of being seen without makeup. Fear of being my stupid self.

Science Hack Day was an incredible experience. It was held at the California Academy of the Sciences, and after the Academy closed to visitors, we were permitted to explore without the nuisance of crowds. We were generously given a private after-hours planetarium show, allowed to sleep in the aquarium overnight, and treated so grandly. Spending the night in the aquarium was a memorable and wonderful experience even though I woke up really sinus-y. I don’t have the best track record of feeling at ease at hack days, bar camps, conferences or parties and I didn’t think I’d fit in, but it was so personally important that I attended and participated. It was basically like a cool specialized summer camp where everyone is interested in the same thing that you are and it ended with a science fair. It was amazing to see all that could be made in just one weekend.

For Science Hack Day my friend Jeremy and I built (and deployed!) Radio Free Earth. We know that radio waves broadcast on earth travel through space and time through a local (to us) region of the universe known as the radiosphere. Radio Free Earth finds the #1 song according to the Billboard Charts on a random (or determined) date, measures how long ago that date was, finds a named star that distance away, and then outputs which star that #1 song is just reaching at this moment. You can also listen to that song and imagine you are on that star! For instance, On Wednesday, April 24th, 1985, We Are the World by USA for Africa was Earth’s number one song. It’s now playing on Chara FOR THE FIRST TIME. It’s like a personal mix tape to the stars from Planet Earth.

Warp over to Radio Free Earth →

The idea went through many phases (compromises), because we were limited by our dataset, which only had data for stars 80 or so light-years away. Jeremy’s initial and more dignified idea, in Chloe-speak, was to associate meaningful events in history with the stars through the length of their light cones. I thought this was very beautiful because looking up at the sky and seeing our history here on Earth is so damn moving. But because our dataset was limited to the past 80 years, this would basically have ended up being a stellar translation of Billy Joel’s “We Didn’t Start The Fire” instead. We also lacked a reliable machine-readable dataset of historical events. A discussion about the radiosphere during the planetarium show inspired us to consider mapping which television shows have reached which stars (trite), but because of familiarity with music APIs and more enthusiasm regarding music data overall, we decided to measure the influence of pop songs instead. Because Echonest didn’t have the particular data we needed and the Billboard API has been disabled, I mined Wikipedia for a complete list of all the Billboard #1 songs since 1940, tidied it up, and converted the HTML to XML to JSON. One of the best things about the whole weekend is that we now have the only machine-readable dataset of every single #1 Billboard song since 1940, and it’s on GitHub, and it’s my greatest accomplishment. You’re welcome, the internet.

We both had similar ideas on how we thought it could look and function – some sort of timeline correlating a list of songs with their star – but given the breadth of our data, it made better sense to rely on a single date instead to pair a song and a star. By midnight, Jeremy had gotten the functionality functioning, I had done some pattern-matching to produce two datasets, and we had a plan for the morning to style and integrate Rdio playback. We also had plans to include the hilarious visual gimmick of spinning the Golden Record while a song plays which I am most excited about because every time I work with Andy on a music project I always want to put a 50% border radius on the album art and make it spin and Andy hates it and this time I finally got to do it. HACK DAY.

Something else that I finally got to do that I’ve wanted to do forever to was to make something that didn’t rely on jQuery. There aren’t a great many DOM manipulations on Radio Free Earth, and our only dependency is the Rdio API, which made it a perfect baby step. It was empowering as hell.

The next morning after not enough coffee and with Swollen Sinus Face, I integrated Rdio playback. We styled it which was actually the low point of the project and deployed it to Heroku mid-morning. Definitely the coolest most best thing ever was learning from Tantek that Firefox supports unprefixed CSS animations while Chrome still needs the -webkit prefix. I was very impressed to have learned this. Evangelize!

Radio Free Earth Poster