UPDATE: Looks like I broke something since it seems the actual player on each page only works in Firefox so far. I’ll debug it tomorrow.
UPDATE2: Alright, it’s working in Firefox and Safari now, probably everywhere else. It was a load order problem with the flash vs. javascript.
I just finished putting up a first rough cut of SongBe.At and I’m looking for people to try it out. This is about a 2 day hack, with most of the work done yesterday.
It’s nothing original. I ripped most of the code out of Fret War and stripped it down to the bare essentials needed for someone to post music they’ve created to a web site. It came about because many people wanted to post music based on the Fret War rounds, but didn’t want to participate. As I asked around, I found people who’d use it if it was basically like their twitter but for posting songs they made.
The end result is basically, in the words of a good friend in the PR world, “Twitter meets Fret War”.
You can check out my page and I even managed to get Giles Bowkett to post something. There’s also buddies from Fret War on there like Hank but otherwise not a whole lot of people yet.
The whole thing is about 500 lines of code, with a ton of borrowed javascript.
It’s an incredibly simple bit of software that’s almost 90% static. It could be 100% static but I’m still tweaking layouts and stuff so it’s easier if it’s not.
The information on a page is constructed entirely from javascript stores on the web server. I basically poached the Librelist JSON archiving code and use it to write JSON versions of the emails you send in. Probably a few XSS attacks in there.
I’m using EJS to do the display templates on a user’s page from the static JSON. How it works is when the page loads it goes and grabs the user’s index.json file. This file lists just the full URLs to the music they’ve posted so far. These posts are kept in a maildir so they can be written to by multiple processes.
Once it has this index.json it builds a bunch of slugs in the page, then it does remote requests for each .json that represents the user’s post. Since these can come from the server in any order they kind of load weird, but quick and reliably.
These post JSON files are created by Lamson whenever you send in a post. It peels the files off, dumps them in some location, and then spits out a JSON file based on your email. This is probably the biggest piece of code, but it isn’t really all that much.
Finally, those nifty little players are from the RightJS project as a pending new UI goodie. I asked Nikolay if he could reduce my pain on SoundManager2 which is a nice idea but holy crap that’s a lot of horrid code to have to write to play some music. He banged out Kinda Player in like a day and I was able to use it. He even has the code on git for you.
He’s a damn genius with the javascripts.
There’s really not a lot I’ll be adding to this from here out. Probably just a few simple things people have requested:
That’s about it. Maybe later when there’s enough people I’ll look at giving each artist a little mailing list for their fans, kind of like librelist.com style simplicity for artists.
Let me know if you find any bugs. I’m sure there are plenty.