This is a guest post from Paul Fenlon, a gifted web developer, drummer, and friend of evolvor.com. Thanks Paul for this wonderful lil’ tool that will make browsing MySpace way less frustrating in the future!
If you’re anything like me, then you probably find yourself swearing at MySpace and the designers that pollute it. For the most part, MySpace pages are cluttered and media-rich, resulting in slow load times or maybe even a browser crash.
I don’t know about you, but the only reason I’m on MySpace is to keep track of bands and find out about new music. So, when I go to MySpace I really only need to see the music player.
With that said, I got motivated a few days ago and decided to put an end to the MySpace media problem. After some toiling, I came up with a pretty good solution: a bookmarklet.
My bookmarklet searches through MySpace source code and grabs only the information needed to play a band’s songs. It then refreshes the page and shows only the Flash music player. Problem solved!
“How do you use the bookmarklet” you ask? Well, you drag the link below to your bookmarks and simply click it anytime you go to a band’s MySpace page. You can load the music player almost immediately after connecting with MySpace.
Please note that I haven’t done any legitimate testing; however, it does seem to work in Opera, Safari 4, and Firefox 3. Also note that add ons like ad blockers or flash blockers will stop the bookmarklet from working.
Here is the JavaScript code (formated for readability)…
var s = document.getElementById('shell'); var t = document.createTreeWalker(s, NodeFilter.SHOW_ELEMENT, null, false); var n, v, m, f; while (t.nextNode()) { if (t.currentNode.tagName.toLowerCase() == 'param') { n = t.currentNode.getAttribute('name'); v = t.currentNode.getAttribute('value'); if (n == 'movie') m = v; else if (n == 'flashvars') { f = v; break; } } } window.location.href = m + '?' + f;
Music-OnlyNOTE: You will need to save this link to your bookmarks.
I hope my Music-Only bookmarklet helps you enjoy MySpace a little more…please let us know if you end up using it!!!
Go ahead and give it a try here (shameless plug!) Julian Day @ MySpace