Display Your Adsense Earnings On Your Taskbar In Your Own Currency

A Firefox Plugin Plus A Little Tweak Will Let You Display Your Adsense Earnings In Your Own Currency

firefox plugin adsense whydowork.com

WhyDoWork.com's adsense plugin plus KeywordSpeak.com's tweak will display your adsense earnings to your local currency on your taskbar

(This post was made for non-US adsense publishers)

I had featured this plugin before, and that was last August this year. Sure it had solved my unstoppable craving to know my adsense earnings from time to time, but there's something that's bothering me.

As months pass by, I had noticed my self on always using my calculator to convert the dollar amount on my local currency, which is Pesos, since I am here in the Philippines. Having this WhyDoWork.com Adsense Monitor eliminated my paranoiac habit of always opening the actual adsense window, but it also created a new downtime of having to convert it to my local currency everytime.

So I have a thought that it would be great if this plugin can also show my earnings on my local currency on the same status bar, right next to the dollar amount. Well, that would be nice, I thought before.

So I searched on where does the files of the firefox plugins were saved and I found them located at C:\Documents and Settings\UserName\Application Data\Mozilla\Firefox\Profiles\7hbeo782.default\extensions.

For Windows 7: C:\Users\UserName\AppData\Roaming\Mozilla\Firefox\Profiles\ojptmnow.default\extensions\wdwadsensemonitor@whydowork.com\chrome\content

Being a programmer that I am, I knew that I have the knowledge to at least try messing up with the code. So I opened the files that I found for that plugin and I saw that the codes that I need to play with are on javascript.

I am a heavy javascript coder myself, so I immediately had a confidence that I can do what I want.

Not long that I did what I wanted, exactly what I wanted. I made it happen that the plugin also shows up my adsense earnings on my local currency, right after the dollar amount.

Enough with the history, here's how you can do it too.

(it is given that you have already installed WhyDoWork.com Adsense Monitor firefox plugin, if not, see how to install this plugin on my previous post)

Installed? okay, let's proceed.

First, open the folder:
C:\Documents and Settings\UserName\Application Data\Mozilla\Firefox\Profiles\7hbeo782.default\extensions\wdwadsensemonitor@whydowork.com\chrome\content

The path maybe different on yours, but it should be something like this.

Then you should find the javascript file named: wdwadsensemonitor.js, open it.

Locate the part that says:
var newString = ourValues[0] + ' - ' + ourValues[1] + ' - ' + ourValues[2] + ' - ' + ourValues[3] + ' - ' + ourValues[4];

The one that we want to edit here is the ourValues[4] variable.

To do this, we need to add this codes right before the var newString... part.

var dollar_value=ourValues[4].substring(1,ourValues[4].length);
var peso_value=dollar_value*42.5;
var peso_formatted=peso_value.toFixed(2);
var dollar_peso= '$'+dollar_value +' / Php '+ peso_formatted;


What's important here is the code that says var peso_value=dollar_value*42.5;, replace the multiplier on your own exchange rate.

Then you will change the line:
var newString = ourValues[0] + ' - ' + ourValues[1] + ' - ' + ourValues[2] + ' - ' + ourValues[3] + ' - ' + ourValues[4];
to:
var newString = ourValues[0] + ' - ' + ourValues[1] + ' - ' + ourValues[2] + ' - ' + ourValues[3] + ' - ' + dollar_peso;

Notice that we just change the ourValues[4] variable to dollar_peso.

After this, you may also want to change the code that says var dollar_peso= '$'+dollar_value +' / Php '+ peso_value;. The text Php on the code represents Philippine Peso, so you may also want to change this.

One last thing to edit though, when you're done with all these code-editing above, the default width originally assigned by the plugin may not be enough for your longer display now. To add some pixels on the width to the taskbar, locate and edit the code:
document.getElementById('wdwadsensemonitor-status').width = '225'; under the code: if (prefManager.getBoolPref('extensions.wdwadsensemonitor.started')).

The default width is 225, adjust it on your desire, I did mine for 270.

So, that's it, you can now see your adsense earnings both on the original dollar amount and on your own local currency, enjoy!



For the technical persons who wants to bother knowing what do each codes does, here's a detailed explanation that summarized them.

var dollar_value=ourValues[4].substring(1,ourValues[4].length); - This will remove the dollar sign on the ourValues[4] variable
var peso_value=dollar_value*42.5; - This will multiply the extracted dollar amount to the local currency
var peso_formatted=peso_value.toFixed(2); - This part will restrict the multiplied values to a two decimal places result
var dollar_peso= '$'+dollar_value +' / Php '+ peso_formatted; - This is to format the dollar amount and the local currency amount, the main appearance on the actual display
document.getElementById('wdwadsensemonitor-status').width = '225'; - Determine the plugin width on the taskbar


4 comments :

  1. thanks, glad you liked it jehzlau!
    spread the word...
    go pinoy bloggers!!!

    ReplyDelete
  2. Nhoel... salamat sa info na ito :) Mabuhay ang mga Pinoy Bloggers!!!

    ReplyDelete
  3. Him

    If you're looking for something to monitor your adsense account earnings, I would recommend that you check this website:

    http://monitoradsenseearnings.blogspot.com

    Cheers,
    Gizmo

    ReplyDelete