Search This Blog

Thursday, March 24, 2011

Getting MetroLyrics Lyrics Saved As A Text File

MetroLyrics - How to save Lyrics as Text


I recently installed Winamp 5.0+ (whatever version it is) and as part of this I wanted to look for info about artists including Lyrics for songs. I was directed to MetroLyrics.com to get lyrics with the following an example page for a song:

http://www.metrolyrics.com/my-name-is-lyrics-eminem.html

As you can see above, this shows you the lyrics but if you try to get the lyrics you cant cut and paste them, nor can you view the source and get the lyrics text that way. So how to get around this was my thought. After a bit of looking I found the following out. There is a div tag with the following HTML:

<div id="lyrics">&#83;&#116;&#101;&#112;&#32; ... etc ... 

and above this there is a second div with the following id:

<div id="lyricsBox">

I'm not 100% sure how they stop you from saving the text with cut and paste...I have my theories that JavaScript is used to stop you right clicking and perhaps somehow marking the lyrics div as non-selectable via a CNTRL+A key stroke but I'm not sure. What I have noticed is that apart from whatever CSS / JS that is used they also take the lyrics which are converted from characters that are human-readable ASCII to Unicode. Hence in the lyrics div the huge set of '&#xxx;' values are the Unicode conversions of each letter in the Lyrics.

My first thought was to view the source, cut out the Unicode from within the 'lyrics' div and then use a web based converter and convert from Unicode to ASCII:

http://www.1pagedesign.com/unicode_ascii_converter/ 
http://www.mikezilla.com/exp0012.html

However the size limitations of the tools and the fact that there are non Unicode HTML break tags (ie: <br />) embedded in the middle caused some issues. So instead I decided to simply use Firefox's HTML parser to display the div but without whatever CSS and JavaScript is being used to stop the cut and paste. By viewing the source and then searching for the div id's, ie: 'lyricsBox' and 'lyrics', I copy the source from the first 'lyricsBox' div start through to the end of the 'lyrics' div containing the Unicode and then save this in a new HTML file. Since I'm not copying any of the associated CSS or JavaScript the HTML I copy is just a couple of plain DIV's with no formatting or attached JavaScript behavior, which as I mentioned earlier is what I believe stops the use of Cut and Paste. Viewing this file in browser will then correctly and automatically display the lyrics by converting the Unicode to the appropriate ASCII characters without any further interference from you required and with no fancy formatting (ie: plain text display in the browser).

Further by copying the div 'lyricsBox' I not only get the lyrics stored in the other 'lyrics' div but also get the Artist name, song title and songwriter name with a bit of bold formatting to make it stand out a bit. Great!!!

So this is a quick and simple way to get around the blocked cut & paste and still get your hands on a HTML or text version of the lyrics (once the HTML is parsed by the browser and viewed it appears as just plain text so you can easily cut and paste this as just plain text if you so wish and want to store this as text rather than HTML/Unicode characters).  I tend to just copy a number of lyrics files (in the form of the 2 DIV's of info) one after another in a single HTML file and then view the whole lot of them at once.

Enjoy :-)

B.T.W: I thought of this because I first noticed that when the page was in the process of loading prior to it being completely loaded it was still possible to highlight the lyrics text, use CNTRL+A to get the text and not only that but viewing the source prior to the page fully loading still displayed the text as ASCII rather than Unicode. This implied that the removal of the cut & paste ability and the conversion of the text to Unicode was something that happened after the page loaded (ie: triggered by CSS or more likely JavaScript) ... which made me think that removing the JavaScript (or in this case ALL JavaScript on the page) would halt the process and break me in at a point when I cold still get at the text. Originally I thought of using Firebug to break into the DIV element and try to manually remove any associated JavaScript or CSS but my final process described above was a much simpler and easier to use process.

Wednesday, March 23, 2011

Firefox 4.0 - released by March 22nd, 2011 - Finally!!!

Firefox 4.0 - Full Non-Beta/RC Version: released by March 22nd, 2011


So we're finally there!!! After 12 Beta and 2 RC (Release Candidate) releases the full and final version of Firefox 4.0 just came out today!!! The actual set of release notes is at:

http://www.mozilla.com/en-US/firefox/4.0/releasenotes/

And this set of release notes provides the usual list of downloads, features etc., but this one is more detailed and contains an overview of ALL work done in the 4.0 version release over the course of all the various Beta's and RC's. This release notes page is actually quite good on providing the detail of changes in FF4.0. If you haven't been working your way through the Beta's and RC's and upgrading and installing as the go then this release will be a fair change in look and feel and functionality so the release notes will be useful in giving you a look at what was done.

There are also a number of useful links Ive found associated with this release. These include the following which is a cool world map showing the number of downloads that have occurred, where they are occurring and how many per minute. Cool stuff...

http://glow.mozilla.org/

Whats more you can break it down to a per city level using an ARC graph and see totals per country and city as well. Cool stuff I say again. The 'about' page for this reads as follows:

glow.mozilla.org tracks downloads for Firefox 4. When someone clicks the download button on mozilla.com or asks for an upgrade from inside Firefox, we approximate their location based on IP address and store anonymous aggregate location information in our database. Each dot that shows up on the map represents someone who just downloaded Firefox (with a few seconds of latency as we process everything on the back-end). The counter at the top shows the total downloads of Firefox since March 22, 2011, when Firefox 4 was released. The arc chart shows those downloads broken down all the way to the city level.

Whats interesting is that out of 6 million downloads Poland has 150K+ while Australia only has 100k+ and further of these only 6000 or so are from South Australia. C'mon Ozzie's download more!!! And looking closer there are 4000 for Adelaide in general but also about 10 lone entries for Modbury and I reckon I would've fallen under that category for the download I just did not long ago. Crazy I'm one of only 10 Modbury FF4.0 users.
 
 
As a side note FF4.0 has got obvious performance improvements which are summed up neatly and concisely here: http://www.mozilla.com/en-US/firefox/performance/, and some similar but more detailed info from a techy/developer point of view: http://hacks.mozilla.org/2011/03/firefox4-performance/. While on that techy/developer side of things this blog is also useful for all things tech in FF4.0: https://developer.mozilla.org/En/Firefox_4_for_developers
 
 

Sunday, March 6, 2011

Firefox 4 - Beta version 12: released by March 5th, 2011 - Last Pre-RC

Firefox 4 - Beta version 12 (Last Pre-RC Version): released by March 5th, 2011


Another Beta version of Firefox just came out a few days ago. Beta 12 was release on the 25th of February to be precise and is supposedly the last of the Beta releases. A few releases back a feature freeze had been implemented and only bugs (primarily blockers) where being worked on.  The Beta 12 release had been delayed a bit but this is the last of the Beta's. The actual set of release notes is at:

http://www.mozilla.com/en-US/firefox/4.0b12/releasenotes/

And this set of release notes provides a list of the Bugs that where fixed. The release is primarily a bug fix and performance release (or thats what its been described as) and includes 659 or so bugs fixed to add to the total 7,000+ fixed since the first Beta release in July 2010.  The bug list gives a bit of a run down and what I thought was interesting was that there were 5 individual bugs fixed for issues with the FireBug plugin. This was interesting as the Beta 11 version broke the FireBug plugin pretty badly and I had to switch it off.  There is also this nice list which provides known issues...and these are all not really bad issues and not really browser based either (more a case of the web sites not being to spec etc.)

Also, the wiki page for Firefox 4 gives a good timeline which provides a nice overview of the release dates over the set of Beta's and the fixes that were done.  The following web site areweprettyyet also gives a nice round up of visual improvements that are being done in FF4 and also scheduled for FF5.

So besides the various bug fixes and performance improvements there is also a visible tweak to the UI. The status bar was removed from the browser UI a few beta's back. For a while the URL of a link etc., was displayed in the address bar on the right hand side. This has been removed and changed now.  While the status bar is not back a similar method is being employed. When hovering over a URL a popup appears in the bottom left hand side in the same way that Chrome and upcoming IE 9 URLs do.  Another change that Ive noticed related to the UI is the popups that occur (i.e.: for a JavaScript alert etc). The shape and look of the popup was very distinctive in previous versions of the browser. Then at around about Beta 10 it changed to a rather than rectangular angular box, to a box with rounded corners and a button with rounded corners in it.  Then in Beta 12 it converted to an angular box and button again.  The border is lighter and light grey.