Printer Friendly Version
Email this thread to a friend
|
Featured Web Site Template |
|
There are 0 guests and 2 members in the forums right now.
Reflects user activity within the last 5 minutes
|
|
| Member |
Message |
mteasdal
Joined: Eons Ago
# Posts: 376
|
Posted: 2005-Mar-13 02:44
I hate typing in my email address and password into adsense to see how much I made a day so I created an autologin tonight.
Create a adsense.asp page on YOUR server. Paste the code below without the start end lines. Replace the username with your email address and the password with your password.
How it works...
I pass a post to the secure server and it takes it. Images don't show up but that doesnt matter. Navigation does not work! It is mostly for seeing what you made that day.
-----------START
<%
Dim objHTTP, strResult
Set objHTTP = CreateObject("Microsoft.XMLHTTP" )
objHTTP.Open "POST","https://www.google.com/adsense/login.do",false
objHTTP.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
objHTTP.send "destination=&username=YOUR-EMAIL-ADDRESS&password=YOUR-SECURE-PASSWORD"
strResult=objHTTP.responseText
Response.Write strResult
Set objHTTP = nothing
%>
-----------END
[ Message was edited by: mteasdal 03/12/2005 07:02 pm ]
|
 |
mteasdal
Joined: Eons Ago
# Posts: 376
|
Posted: 2005-Mar-13 03:13
Notice how I said JUST created it. *GRIN* With some more thought into it I should have security on the page so others don't see it. Hmm another login LOL I have done it with auto authentication so I am fine. Other with unix can secure it using .htacces or something like that.
|
 |
Mark Wolk
Joined: Sep 19, 1999
# Posts: 660
|
Posted: 2005-Mar-13 09:08
...or just use Roboform.
|
 |
mteasdal
Joined: Eons Ago
# Posts: 376
|
Posted: 2005-Mar-13 14:38
That looks like a better solution. THX
|
 |
Prowler
Staff
Joined: Aug 14, 2000
# Posts: 1788
|
Posted: 2005-Mar-14 13:18
There was a similar login script using Perl to parse a HTTPS page to extract a Bank's account statement at the end of every day somewhere in the Perl forum sometime back.
That could be used to extract this information from Adsense. The advantage is you don't need a server to run your ASP script. You can run this off your command line and can be scheduled to run at specific time every day.
|
 |
mteasdal
Joined: Eons Ago
# Posts: 376
|
Posted: 2005-Mar-17 16:39
Prowler - Right on the money! I could schedule a script to go into the adsense page and scrap the total for that day then email it to me. I could run it from a .vbs script. I LIKE THAT!
|
 |
mteasdal
Joined: Eons Ago
# Posts: 376
|
Posted: 2005-Mar-18 05:05
This is for advanced users that know Visual Basic Script (VBS). This code was written in about an hour and it has not been totally tested but it worked for me and that is enough. *GRIN* Play nice kids!
This code will send you a email of your earnings form adsense every day if you schedule it.
Create a file named adsense.vbs on your PC computer. Add the code below but replace YourEmailAddress with your email address and YourPassword with your password and you will be set.
Click on the file and you will see your earnings in a msgbox and then click ok and a email will be sent to you with your earnings. If you schedule this you will have to comment out the msgbox line.
'-------------------START
Dim objHTTP, strResult, strPassword, strEmailAddress
' MUST ADD USER NAME AND PASSWORD HERE...
strEmailAddress = "YourEmailAddress"
strPassword = "YourPassword"
Set objHTTP = CreateObject("Microsoft.XMLHTTP" )
'Goes to login page and passes username(email address) and password to the server to login
objHTTP.Open "POST","https://www.google.com/adsense/login.do",false
objHTTP.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
objHTTP.send "destination=&username=" & strEmailAddress & "&password=" & strPassword
' Gets the HTML source results returned
strResult=objHTTP.responseText
'Strips out html and leaves the total for that day
strResult = FormatData(strResult,"<html>(.n)+?[" & Chr(36) & "]","" )
strResult = FormatData(strResult,"Totals(.n)+?</html>","" )
strResult = FormatData(strResult,"(.n)+?top" & chr(34) & ">","" )
strResult = FormatData(strResult,"<(.n)+?" & chr(34),"" )
'holds the dollar amount for total for today and adds a few more details
strResult = "Total for today: " & strResult & Chr(10) & Chr(13) & "Time: " & Now()
' If you automate this you will want to comment this line out.
' Gives you the message that you will see in the email
MsgBox strResult
Set objHTTP = nothing
' Sends email to the login email address with results
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Const cdoSendUsingPort = 2
set iMsg = CreateObject("CDO.Message" )
set iConf = CreateObject("CDO.Configuration" )
Set Flds = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing" ) = 1 'cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver" ) = "smtp.server.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" ) = 10
.Update
End With
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = strEmailAddress 'strTo
.From = strEmailAddress 'strFrom
.Subject = "Adsense for " & NOW() 'strSubject
.HTMLBody = strResult 'strHTMLBody
.Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
Function FormatData(StrQuery,FindPattern,ChangeTo)
Dim objRegExp1, strOutput
Set objRegExp1 = New Regexp
objRegExp1.IgnoreCase = True
objRegExp1.Global = True
objRegExp1.Pattern = FindPattern
strOutput = objRegExp1.Replace(StrQuery, ChangeTo)
Set objRegExp1 = Nothing
FormatData = strOutput
End Function
[ Message was edited by: mteasdal 03/18/2005 09:11 pm ]
|
 |
Prowler
Staff
Joined: Aug 14, 2000
# Posts: 1788
|
Posted: 2005-Mar-18 13:08
Nice work mteasdal. A caveat is in order here. Make sure that no one else has access to this computer you are running this script. The password is stored in plain text format...
Whilst at it, why bother waiting for mails to announce the earnings ? How about a popup dialog box that tells you <b>you have just made XYZ dollars in Adsense</b> at predetermined interval ?
|
 |
mteasdal
Joined: Eons Ago
# Posts: 376
|
Posted: 2005-Mar-18 17:04
Currently the code triggers a dialog box popup that shows the dallars earned.
Sometimes I see the cached version in a browser and I have to click refresh to be sure I see the real amount. This msgbox will alway see the most current amount.
|
 |
mteasdal
Joined: Eons Ago
# Posts: 376
|
Posted: 2005-Mar-19 05:14
The code has errors due to this site stripping the pipes and backslashes. If you want the code PM me.
This code <(.n)+?
Needs to be replace with <(.PipeBackslashn)+?
|
 |
mteasdal
Joined: Eons Ago
# Posts: 376
|
Posted: 2005-Mar-19 05:52
I will try and post source that works on another site
[ Message was edited by: mteasdal 03/18/2005 10:05 pm ]
|
 |
123_123
Joined: Apr 18, 2005
# Posts: 137
|
Posted: 2005-May-11 19:04
I need the code to use so it will send me messages on the mobile, so the phone vibrates each time I make money with adsense, and also plays a different tune on the phone which would trigger depending on the amount of the increase.
It could also have a top earning tune, which if triggered dialled a preprogrammed telephone number to book a nice cruise !
Google rocks
|
 |
xor83
Joined: May 13, 2005
# Posts: 1
|
Posted: 2005-May-13 16:47
this script giving me error message on "FormatData" function can u help me?
my code look like this :
Star
Dim objHTTP, strEmailAddress, strPassword, strResult
Set objHTTP = CreateObject("Microsoft.XMLHTTP"
objHTTP.Open "POST", "https://www.google.com/adsense/login.do?", False
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.send "username=xxx&password=xxx"
strResult = objHTTP.responseText
Text1.Text = strResult
Set objHTTP = Nothing
End
Actually it's mteasdal code but i pasted in vb6 but i am getting problem in this code it retrive inforomation from adsense but when i change diffrent account it retrive information for last account it does not update the account to new one
plz help me where is the problem
thanx
[ Message was edited by: xor83 05/13/2005 10:43 am ]
|
 |
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
- You have not yet logged in, or registered properly as a member
- You are a member, but no longer have posting rights.
- This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you cannot find this message, click here to Re-Send it.
|
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.
|
Switch to Advanced Editor and ...
Create a New Topic
or Reply to this Thread
|
|