Windows Vista Adsense Gadget

Discussion in 'AdSense' started by giraph, May 5, 2007.

  1. #1
    giraph, May 5, 2007 IP
    trafficfacts likes this.
  2. yourihost

    yourihost Well-Known Member

    Messages:
    1,708
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    115
    #2
    How do we know it doesnt steal out details ? :p
     
    yourihost, May 5, 2007 IP
  3. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I guess you don't, and you don't have to use it either, but I wouldn't ruin my reputation doing something stupid like that.

    Anyway it's up to you, no harm to me if you don't use it, I just made it for myself, and thought I would share it.
     
    giraph, May 5, 2007 IP
  4. trafficfacts

    trafficfacts Peon

    Messages:
    114
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hey,

    Will keep this tool in mind, and use it if I ever decide to get vista, as for my data, you are more than welcome to have it... ;)

    Cheers!!!
     
    trafficfacts, May 5, 2007 IP
  5. pixads

    pixads Well-Known Member

    Messages:
    2,015
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    145
    #5
    is it open source?
    would be nice to be able to check it and customize...
     
    pixads, May 5, 2007 IP
  6. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you feel like seeing what I did, you can look at the javascript files in your gadgets folder. As for the part I did in C# in the .dll file, it's simply:

    
    using System;
    using System.Runtime.InteropServices;
    using System.Net;
    
    using Atom;
    
    namespace Atom.Adsense
    {
    	/// <summary>
    	/// A gadget that obtains adsense statistics.
    	/// </summary>
    	[ComVisible(true)]
    	public class AdsenseAccount : IDisposable
    	{
    		string _Username;
    		string _Password;
    		CookieContainer _Cookies;
    		Uri _CurrentUri;
    		string _CurrentPage;
    
    		public AdsenseAccount(string Username, string Password)
    		{
    			_Username = Username;
    			_Password = Password;
    			_Cookies = new CookieContainer();
    		}
    		public bool Login()
    		{
    			try
    			{
    				string PostData = "continue=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&followup=https%3A%2F%2Fwww.google.com%2Fadsense%2Flogin-box-gaiaauth&service=adsense&nui=15&fpui=3&ifr=true&rm=hide&ltmpl=login&hl=en_US&alwf=true&GA3T=SDVHLfR--a4&Email=" +
    					System.Web.HttpUtility.UrlEncode(_Username) + "&Passwd=" + System.Web.HttpUtility.UrlEncode(_Password) + "&null=Sign+in";
    				_CurrentPage = Web.Navigate("https://www.google.com/accounts/ServiceLoginBoxAuth", _Cookies, PostData, out _CurrentUri);
    				if (_CurrentPage.Contains("Username and password do not match."))
    				{
    					return false;
    				}
    				string NextPage = _CurrentPage.Substring(_CurrentPage.IndexOf("Please"));
    				NextPage = Tools.StringBetween("\"", "\"", NextPage);
    				_CurrentPage = Web.Navigate(NextPage, _Cookies, out _CurrentUri);
    				Refresh();
    				return true;
    			}
    			catch
    			{
    				return false;
    			}
    		}
    		public string CTR
    		{
    			get
    			{
    				//Find CTR from _CurrentPage
    				//Not used
    				return "0.00%";
    			}
    		}
    		public string Earnings
    		{
    			get
    			{
    				return Tools.StringBetween(
    					" </td> <td colspan=\"4\"> </td> <td style=\"font-weight:bold;\" nowrap> ", " ", _CurrentPage);
    			}
    		}
    		public void Refresh()
    		{
    			_CurrentPage = Web.Navigate("https://www.google.com/adsense/report/overview?timePeriod=today", _Cookies, out _CurrentUri);
    		}
    		public void Dispose()
    		{
    			_Cookies = null;
    			_CurrentPage = null;
    			_CurrentUri = null;
    		}
    	}
    }
    
    Code (markup):
     
    giraph, May 5, 2007 IP
  7. trafficfacts

    trafficfacts Peon

    Messages:
    114
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I guess the code is enough proof that people have no concerns about the security of their personal information.

    Thanks for showing the code, anyways :)

    Cheers!!!
     
    trafficfacts, May 5, 2007 IP
  8. pozer

    pozer Active Member

    Messages:
    603
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #8
    gadget is great and thanks for providing us with the code
     
    pozer, May 5, 2007 IP
  9. The Stealthy One

    The Stealthy One Well-Known Member Affiliate Manager

    Messages:
    3,043
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    105
    #9
    Hey, that's cool! Thanks! :)
     
    The Stealthy One, May 5, 2007 IP