The GW Micro blog has been discontinued. For instant updates on GW Micro products and events, follow us on Twitter, and like us on Facebook.


Sleuthing Sources Solves Snafus

by Aaron Smith on Tuesday, January 13 2009

Did you know that every web page you visit is really just a big set of instructions that tell the browser how to display the stuff you're reading? It's very easy to forget about the underlying engine that's bringing you all that exciting content. Take this blog entry, for example. There are commands in its markup that indicate headings, paragraphs, images, links, and lots of other stuff. If you've never read through the source of a web page, take a few minutes to do so. Both Internet Explorer and Firefox provide a "View Source" option in their respective View menus. From snarky developer comments, to detailed information about ads and tracking statistics, you never know what you'll find. But sleuthing source can provide you with more than just a glimpse of the mind behind the page. You can also get access to otherwise inaccessible information. A customer wrote to us recently regarding a web page (http://www.cardiffmiller.com/artworks/walks/ghostmachine.html) that included embedded MP3 files that used the Quicktime media applet for playing. Unfortunately, the Quicktime media applet doesn't have any accessible controls, and getting to the play buttons with the mouse is difficult at best. But this customer said he found a mention of the embedded MP3 file by examining the source of the page. Now that's the kind of investigative initiative I like to hear. So here's how to get that embedded MP3 itself for use in the media player of your choice. In the source, find the SRC attribute that contains the URL to the MP3. For example: ../../media/walks/21_Ghost_Machine.mp3 That's a relative URL, meaning that it's relative to the current domain. You can tell because of the double period paths. So you know the URL of the page you were on when you viewed the source: http://www.cardiffmiller.com/artworks/walks/ghostmachine.html The current directory would be the URL without the HTML filename, or: http://www.cardiffmiller.com/artworks/walks/ Since the MP3 URL starts with two double periods, and that means go up two directories (You might recognize that syntax from command prompt usage), you then know that the MP3 URL will start with: http://www.cardiffmiller.com/ You can then tack on the rest of the MP3 URL that follows the two double periods, and come up with: http://www.cardiffmiller.com/media/walks/21_Ghost_Machine.mp3 Viola! You now have a URL to an MP3, which you can pop into your media player of choice, completely bypassing the Quicktime applet altogether. You might also chose to download the MP3 (using the download method of your choice) to play outside the browser. That's a good example of how a bit of snooping can give you the resources to get around accessibility issues. There's something else to be said for the freedom of playing the media you want to play in the media player of your choice instead of being forced to use some specific web based player. Now go forth, and sleuth it up. There are lots of secrets to discover in the source of the Interwebs.


Return to Article List