I thought it would be really funny to a subdomain that just redirected you to a random Motorhead video on YouTube.

So I did.


To make work, I first pulled a list of all the Motorhead MP3s I have in Python. Then I figured out how to write a redirect page in JavaScript. Then figured out how to randomize the redirect, and used a Google Feeling Lucky query set for to query for "motorhead youtube SONG NAME."

I did it in Python by loading my library from my Python project MPy3Syncer, and then printing all Motorhead song titles. The JavaScript randomly picks a song title, and boom you're redirected.


import pickle  
lib = pickle.load("audioLibrary.PKL")  
for UID in lib.artist["Motorhead"]:  
    print lib.UID[UID].trackName.replace(" ","+")

This, obviously, made me create and


<script type="text/javascript">  
    var titles = new Array("SONG", "Names","Here");  
    var title = titles[Math.floor(titles.length*Math.random())]  
    uRL = "" + title + "&btnI=1"  
    window.location = uRL  

All of this part went nice, getting Apache to play nice with doing subdomains with virtual hosts, not so much. But that turned out to just be because of some cruft from a now-disabled phpmyadmin installation and configuration.