kai 'oswald' seidler (blog)

MacAdSense: Simple AdSense Widget for Mac OS X

adsenseicon.gifJune 10th 2007: Since two weeks I’m using Mac OS X as my main desktop operating system and one thing I soon missed was the wonderful SysSense tool informing me about my Google AdSense earnings. I quickly found some Dashboard widgets claiming to do likely the same as SysSense. But, possibly because Google changed the way of authentication recently, none of these tools worked.

For me as a developer that was a welcome motivation to write my own and very first Mac OS X widget. After reading tutorials like Build a Dashboard Widget by Andrew Anderson, and Andrew Hedges’s Developing Dashboard Widgets I started programming. As reference I strongly recommend Apple’s Dashboard Programming Topics.

Features

It’s quite simple. MacAdSense shows your AdSense earnings, click count, eCPM values for the current month, and the extrapolated earnings for the whole month (by using a very simple rule of three method) on your dashboard. All values are updated every 20 minutes.

Similar tools are using a much faster frequency, but for me 20 minutes is quite fast enough. To everyone who wants a more faster update: Guys, don’t spend the whole day watching your dashboard. ;)

Additional Features:

  • MacAdSense is small, the download is exactly 40 KB “big”.
  • It’s written in PHP so you can read and change the code if you want.
  • It’s published under the GPL license, so after your changes you’re allowed to redistribute it.
  • Runs on Intel and PPC Macs.

System Requirements:

  • Mac OS X 10.4 or later (Intel or PPC)
  • 88 KB free on disk

Screenshots

Let’s take a quick look at this widget:

Simple AdSense Widget
At the widget’s front side you see the total earnings for the current month, the time the widget last updated, the number of clicks, the eCPM value and the extrapolated earnings for the whole month.

At the back side you see the widget’s setting: Your AdSense username and password. In a future version you’ll be able to give your widget a unique name or another color to distinguish it from other widgets and to get the ability to monitor multiple AdSense account.

Download and Install

To install the widget please follow these few, little and simple steps:

  1. Download the latest version from here.
  2. Double click the downloaded file to extract the archive.
  3. Now double click the extracted package to install the widget to your dashboard.
  4. On the dashboard move your mouse pointer over the widget and wait some moments. A little i will appear on the right lower corner.
  5. Click on that i and you’ll get to the widgets back side.
  6. Enter your AdSense credentials and click the done button.
  7. The widget now switches back to the front side and after a view seconds you will see your AdSense data.

If you encounter any problems in using this piece of software please feel free to get in contact with me.

Change Log

2007-06-10: Initial release of first version. (Version 0.1)

2007-06-12: Username and password are now stored in your systems keychain. (Version 0.2)

2007-07-05: Fixing minor bug when showing US$ values above 999. (Version 0.3)

2007-10-07: Google recently changed login API (Version 0.4)

2007-11-30: Small bugfix, see comments from November 30th below. (Version 0.5)

2008-01-13: Google changed login API again (Version 0.6)

2008-07-27: Format change according eCPM value, and another login API change (Version 0.7)

2009-09-01: Snow Leopard Compatibility Update (Version 0.8)

2009-10-05: Google changed login API again and another Snow Leopard Compatibility Update (Version 0.9)

To-Dos

Just don’t forget the future:

  • 20 minutes rule to avoid high frequency querys to AdSense server
  • Store credentials in keychain
  • Allow multiple AdSense accounts
  • Find a better way update the keychain (if there is one day a GData API for AdSense)
  • Simple currency conversion

Copyright and Licence

Copyright (C) 2007-2009 Kai ‘Oswald’ Seidler, http://oswaldism.de

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Additional Credits

This software contains some code snippets taken from amznVibe at WebmasterWorld and was heavily inspired by Jud Stephenson’s Adsense widget.

AdSense is a trademark by Google Inc. and neither this software nor the author is affiliated in any way with Google Inc.

34 Kommentare


Tim
15.6.07 10:03

Great! Just what I wanted. Runs like a charm!



Matthias
25.8.07 12:15

It would be great to aditionally see the daily figures… :-)



hexstatik
18.9.07 08:20

finally! an adsense widget that finally works. Thank you very much.



Janos
11.10.07 23:26

Finally, an AdSense widget that actually works!

As someone said above it would be great to be able to set it to show how much I earned today.

Many thanks anyways!



Janos
21.10.07 00:51

Dead tired, just dropping by to leave a note about MacAdSensePlus (hah, how original):
http://www.flickr.com/photos/janos/1659421895/
I will contact you Kai for further discussions (probably tomorrow).
Good night! :)



Andrzej
7.11.07 14:55

V. 0.4 stopped working a few days ago. Says “can’t fetch data”. Probably some re-coding on G’s side, or…? Need a widget upgrade …ㅜㅜ



Oswald
11.11.07 15:09

@ Andrezej: Do you still have the problem? On my side everything works fine since 0.4, but it’s true, Google seems to use different servers with different auth methods at the same time. I wish there would be an official API to access these kind of data. Google Data API team, do you hear my cry? ;)



Andrzej
11.11.07 21:51

works again. Pheeew, I thought it would be permanent this time. Thx Oswald! Btw I wonder why Google still didn’t come up with some adsense client for Mac…



paul
29.11.07 22:56

The widget was working fine for me until 2 days ago. Now it ignores the actual dollar amount and just shows $1.90.



Oswald
30.11.07 10:06

@ Paul: Same here. Checked it and found the bug quickly: Google uses on several places values containing two periods (eg. 1.234.56) which is obviously not a “real” value. 0.5 fixes this.



beastiality
30.11.07 14:55

Great! :)
Greatisssssimo!



paul
30.11.07 18:06

Awesome! Thanks for coming out with an update so quickly. And thanks for making this widget. :)



Andres
5.12.07 01:25

I just installed it. I got my adsense account with my google account login. When I put my google mail address and password in the widget, it just Says “can’t fetch data”. Can’t make it work.



Andres
5.12.07 01:28

Now is working… who knows what happened…



Cristiano Betta
4.1.08 18:11

Hi, the widget doesn’t seem to work for me (nor do any of the other adsense widgets). All seem to have issues with fetching the data. Maybe Google changed the API?



Oswald
4.1.08 22:15

Cristiano, I don’t know what’s going on with Google AdSense server. Maybe you are using another AdSense server with a different API. My widget works fine from here. Maybe wait a day or two and try again.

Does anyone else also currently encounter problems?

I still pray that Google will also use someday the wonderful Google Data API for retrieving AdSense earnings data.



Gary
20.1.08 06:15

Oswald ,, any chances you would make a more detailed info widget like the one “Janos” (on previous comments) Makes reference as tweaked by him? so called (Mac adsense Plus)

I love to see all the additional agregate data on the widget.. (i.e todays’s, week, month, last month, etc) http://www.flickr.com/photos/janos/1659421895/

However Janos doesnt seem do a very good job keeping his modified widget up to date as you do.. !

with the new Google Login API it stopped working .. and you came quickly with a fix..

Please let us know if there are any chances you would make the Real Mac adsense Plus available (By the Original Creator.) ;)

Thanks for your great Work ..

Gary



Oswald
27.2.08 00:12

Hi MacAdSense users!

If you currently get “can’t fetch data” errors, please log into the AdSense web site and accept the new contract details. After that, MacAdSense will work again.

Greetings
Oswald

PS: Gary, I’m sorry, but I’m currently too busy to make big improvents to MacAdSense. Would be much easier if there were an regular API to fetch the data. Currently it’s a hack and it’s no fun in programming hacks.



KK
1.3.08 21:07

Getting CFD, “can’t fetch data”. Worked well up until Feb. 27/28th. I accepted the new AdSense contract details over a week ago, there are no new contracts for me in any case. So, useless until we have a fix. As a matter of note, none of my AdSense widgets are working at this point. I have all that are available, it seems Google has changed something in the last few weeks or so. Until a fix is found, I like others will now have to log-in to Google AdSense just like in the pre-widget days. Someone will have a fix I am sure. Good widget while it lasted.

Cheers, KK



Vince LaMonica
21.3.08 13:43

FYI, I just accepted the new Google Adsense terms, and then I loaded up this version of the widget, re-inputing my password, and it worked fine. So the key is to flip the widget over [both this one and the "Plus" version] and retype one’s password. Then the widgets will work fine with Google Adsense.

Hope this helps.

/vjl/



Jud Stephenson
26.3.08 17:49

Hi Oswald
I really like the widget, I just now got back into developing mine. I feel your pain as far as having to constantly change the login methods because google can’t keep anything the same for more than 4 months ;) . Great widget, definantly a great download.

Jud



Emanuele
29.7.08 09:26

Thanks for your work! ;-)
Bye,
Emanuele



myosxfreeware
1.8.08 19:13

[...] MacAdSense shows your AdSense earnings, click count, eCPM values for the current month, and the extrapolated earnings for the whole month (by using a very simple rule of three method) on your Dashboard. All values are updated every 20 minutes. [...]



Guppytrucs
3.8.08 02:06

[...] MacAdSense est un widget pour votre Dock, afin d’avoir un aperçus de votre compte adsense. Celui-ci est mis à jour toute les 20 Minutes et vous pouvez ainsi voir le nombre de clics, et le taux pour 1000. [...]



DOCa Cola
6.8.08 12:58

very useful widget, thanks alot! :)



lsi
4.9.08 20:51

it would be better with other languages support, but thanks..



Bob
3.6.09 16:30

dead in the water. stopped working recently.



Mac Babe
7.8.09 00:12

this thing doesn’t work.. is there any solution?



Emanuele
11.9.09 14:09

My widget is working fine but I have an AdSense account in euro value. I can open the widget with Dashcode but I can’t find where to change the $. I would like to show the € symbol.
Thanks for your work,
Emanuele


[...] MacAdSense It’s quite simple. MacAdSense shows your AdSense earnings, click count, eCPM values for the current month, and the extrapolated earnings for the whole month (by using a very simple rule of three methods) on your dashboard. All values are updated every 20 minutes. [...]



pflat
20.10.09 10:10

Thanks for updating the widget. I’ve been using it for the past few months, and it’s a great tool. If ever you’re working in the UK, you can use my free uk tax calculator at listentotaxman.com.



Juan Cabanela
5.11.09 22:02

Any idea how to troubleshoot login failures? I have removed the Adsense keychain and Widget preferences and when I type in my login credentials (which used to work), it fails to login to Google Adsense. I am competent at poking around on the command line, so any suggestions for how to diagnose this problem would be appreciated.



Ross Shannon
2.3.10 21:12

@Emanuele You update the MacAdSense.js file in the widget’s package to display the euro symbol instead of the dollar symbol. Update line 116 to look like this:
document.getElementById(”earnings”).innerHTML = “€” + output[2];

The extrapolated line should be updated too.

Thanks for the widget Oswald. It’s great, and the only one I could find that still works!



Admirer
7.3.10 22:39

Thank you very much for this widget, Oswald! I’ve been desperately searching for an Adsense widget that still works and this is the only one I found. I love its simplicity.

Thank you for the good work,
Admirer


Leave a Reply

 

oswaldism.deblog.oswaldism.demicroblog.oswaldism.degallery.oswaldism.de