It is currently June 27th, 2019, 11:04 am

Need help regarding gmail skins

Help with creating, editing & fixing problems with skins
Chaoz
Posts: 19
Joined: May 28th, 2009, 12:15 am

Need help regarding gmail skins

Chaoz » December 16th, 2010, 7:10 am

I have two gmail accounts; 1 and 2 for simplicity. The problem is that the skin will show the mail from account 2, while I have inputted account logins for account 1. It'll only display account 1's mail when I log out of account 2. I've tried several skins and this problem persists.

Code: Select all

; ENIGMA TASKBAR GMAIL ICON
; Enter your Gmail username and password below.

[Rainmeter]
Author=Kaelri@gmail.com
AppVersion=1.0
Update=1000

[Variables]
update.Spd=60
FontColor=198, 60, 207
FontColor2=255, 255, 255, 160
FontName=Calibri
FontHeight1=10
FontHeight2=7
AntiAlias=1

User=
Password=

Link=http://www.gmail.com/
Browser=firefox.exe
; -------------------------
s
[MeasureGmail]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=https://name:password@gmail.google.com/gmail/feed/atom
RegExp="(?siU)<fullcount>(.*)</fullcount>"
Codepage=0
Download=1
UpdateRate=120
StringIndex=4


[MeasureNumber]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureGmail]
StringIndex=1
UpdateRate=140

; -------------------------

[Mail]
Meter=IMAGE
ImageName=MAIL.png
X=0
Y=0
W=25
H=25
AntiAlias=1
LeftMouseupAction=!Execute ["#Browser#" "#Link#"]

[Number]
Meter=STRING
MeasureName=MeasureNumber
X=32
Y=10
H=10
W=20
FontColor=#FontColor#
FontFace=#FontName#
FontSize=#FontHeight1#
StringAlign=CENTER
StringStyle=NORMAL
AntiAlias=1
Text="%1"
AntiAlias=1
AutoScale=1
NumOfDecimals=0
User avatar
Alex2539
Rainmeter Sage
Posts: 648
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: Need help regarding gmail skins

Alex2539 » December 16th, 2010, 1:45 pm

I have absolutely no problems with two skins retrieving information from two different GMail accounts. However, if by "show the mail" you mean when the skin is clicked to open GMail in your browser, then it has nothing to do with Rainmeter. The skin never actually logs you in to your GMail account, it just uses your credentials to retrieve your messages in a feed that Rainmeter can easily parse. When you open GMail in your browser, it uses browser cookies to determine what account is logged in and shows the inbox for that account. To change the account that is logged in, you need to log out from the current account, then log back in to the new one. There is no way for Rainmeter to do this for you.
ImageImageImageImage
Chaoz
Posts: 19
Joined: May 28th, 2009, 12:15 am

Re: Need help regarding gmail skins

Chaoz » December 16th, 2010, 5:45 pm

I don't mean when it opens my browser. I mean the number of new messages it shows on the skin itself. I actually have account 1 logged in in Firefox and account 2 in Internet Explorer. I don't know if that makes a difference. When I log out of IE, then it will show the mail from Firefox.
User avatar
jsmorley
Developer
Posts: 19272
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need help regarding gmail skins

jsmorley » December 16th, 2010, 5:57 pm

Rainmeter skins don't know or care what browser you use really. The account the skin displays is entirely controlled by this line in the skin(s):

URL=https://#GMailID#:#GMailPassword#@gmail.google.com/gmail/feed/atom

Those two variables: #GMailID# and #GMailPassword# tell Rainmeter which account to access.

You can either hard code them, like:

URL=https://FrodoBaggins:1RingToRuleThemAll@gmail.google.com/gmail/feed/atom

or use them as variables as in my example:

[Variables]
GMailID=FrodoBaggins
GMailPassword=1RingToRuleThemAll

[GMailMeasure]
...
URL=https://#GMailID#:#GMailPassword#@gmail.google.com/gmail/feed/atom
...

If you have measures or skins getting confused about which account to display when, there may be a conflict with using the same #Variable# in two places.
Chaoz
Posts: 19
Joined: May 28th, 2009, 12:15 am

Re: Need help regarding gmail skins

Chaoz » December 16th, 2010, 6:13 pm

I tried both hardcoding and entering a variable one at a time. It still shows the wrong account.
User avatar
jsmorley
Developer
Posts: 19272
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need help regarding gmail skins

jsmorley » December 16th, 2010, 6:27 pm

Well, from the code you posted, I'm not clear what you are doing. Did you make a copy of the skin and are running two versions of it that each check a different account, or are you checking both accounts in the same skin? I'm glad you removed the actual id and password from the [Variables] when you posted, but I also don't see any proper variables in the URL= line. Variables are used with #Varname# (the # chars are important)

Post your entire skin code. Just replace your id and password in the [Variables] section with xxxxx or something. Then tell us how you expect it to work. Do you want to duplicate the part of the skin getting and displaying the count and have a single skin check both accounts, or is this one skin of two, where each skin accesses a different account?
Chaoz
Posts: 19
Joined: May 28th, 2009, 12:15 am

Re: Need help regarding gmail skins

Chaoz » December 16th, 2010, 6:50 pm

I'm only running one instance of the skin, and the only mail skin I'm running. I just want to check on one account. I switched to a new skin so the code is a bit different. And are you saying I should leave the # in (in both the harcode and variable)? When I leave them in, the skin won't show the number of new messages so I assumed it wasn't working.

Code: Select all

[Rainmeter]
Author=r3ginald
;Edited by Vick88
Update=1000

[Variables]
GMAILURL=https://mail.google.com/mail/feed/atom
GmailUsername=#YOUR USER NAME#
GmailPassword=#YOUR PASSWORD#
Substitute="&":"&",""":"","&Quot;":"","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'"

;--------------
       Gmail
;--------------

[MeasureGmail]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=https://xxxxxx:xxxxx@gmail.google.com/gmail/feed/atom
RegExp="(?siU)<fullcount>(.*)</fullcount>"
Codepage=0
Download=1
UpdateRate=60
StringIndex=4


[MeasureNumber]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureGmail]
StringIndex=1
UpdateRate=1

;--------------------

[GmailIcon]
Meter=IMAGE
ImageName=gmai_l.png
X=5
Y=11
W=45
H=45
AntiAlias=1
LeftMouseDownAction=!Execute ["C:\Program Files\Mozilla Firefox\firefox.exe" "http://www.gmail.com/"][!RainmeterRedraw]

[Sep]
Meter=IMAGE
ImageName=sep.png
X=37
Y=5
W=90
H=45
AntiAlias=1

[Messages]
Meter=STRING
MeasureName=MeasureNumber
X=73
Y=18
FontColor=255,255,255
FontFace=Segoe UI
FontSize=11
StringAlign=LEFT
;StringStyle=BOLD
AntiAlias=1
Text="%1"
;Postfix=" new messages"
AntiAlias=1
AutoScale=1

[Messages2]
Meter=STRING
X=52
Y=33
FontColor=255,255,255
FontFace=Segoe UI
FontSize=8
StringAlign=LEFT
;StringStyle=BOLD
AntiAlias=1
Text="unread mail"
AntiAlias=1
AutoScale=1

;------------------

[Filter]
Meter=IMAGE
Solidcolor=0,0,0,0
X=0
Y=0
H=210
W=170



User avatar
jsmorley
Developer
Posts: 19272
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need help regarding gmail skins

jsmorley » December 16th, 2010, 7:08 pm

I'm now a bit confused myself. If you are using just one skin, and it is checking only one account, then I don't get the issue.

In any case you have the variables backwards and one problem with StringIndex is all. See my edits to your code.


[Variables]
GMAILURL=https://mail.google.com/mail/feed/atom ;This line is pointless. You are never using this variable and don't need it.
GmailUsername=FrodoBaggins
GmailPassword=1RingToRuleThemAll

Substitute="&":"&",""":"","&Quot;":"","<br>":"","![CDATA[":"","]]":"","...":"","<":"",">":"","/PRE>":"","PRE>":"","<":"","'":"'" ;Not needed. This skin just returns a number, and you are never using the variable in any case.

;--------------
Gmail
;--------------

[MeasureGmail]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=https://#GmailUsername#:#GmailPassword#@gmail.google.com/gmail/feed/atom
RegExp="(?siU)<fullcount>(.*)</fullcount>"
Codepage=0
Download=1
UpdateRate=60 ;See below...
StringIndex=1 ;You are returning only one element, the "count". Never ever going to get to a StringIndex of 4 with this measure.

That will check the count of new mails for the account FrodoBaggins@Gmail.com, and only that account, and will always display the count for only that account. There is no way it can access any other GMail account you may have. What happens when you launch your browser is of no relevance. THAT will go to whatever account you are currently logged into in your browser, based on a cookie that GMail will give it. Nothing to do with Rainmeter.

I was sorta assuming you wanted to check two accounts in one skin, and that it was getting confused about which account is which. Just for future reference, that can be done like this:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Account1ID=FrodoBaggins
Account1Pass=1RingToRuleThemAll
Account2ID=GandalfTheGrey
Account2Pass=IHateMordor


[MeasureAccount1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=https://#Account1ID#:#Account1Pass#@gmail.google.com/gmail/feed/atom
RegExp="(?siU)<fullcount>(.*)</fullcount>.*"
StringIndex=1
UpdateRate=300

[MeasureAccount2]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=https://#Account2ID#:#Account2Pass#@gmail.google.com/gmail/feed/atom
RegExp="(?siU)<fullcount>(.*)</fullcount>.*"
StringIndex=1
UpdateRate=300

[MeterAccount1]
Meter=String
MeasureName=MeasureAccount1
X=0
Y=2R
FontFace=Segoe UI
FontSize=13
FontColor=255,255,255,255
AntiAlias=1
Text=#Account1ID# has %1 New Mails

[MeterAccount2]
Meter=String
MeasureName=MeasureAccount2
X=0
Y=2R
FontFace=Segoe UI
FontSize=13
FontColor=255,255,255,255
AntiAlias=1
Text=#Account2ID# has %1 New Mails
By the way, unless your Windows is set to some character set other than English, This line on the measure:

Codepage=0

Is pointless as the default is "0". You would only set it if you needed Kanji or Cyrillic or some other character set, and it would never need to be set to "0".

Also, given that GMail has no image or anything to download when you are getting the "count", this line is pointless:

Download=1

And finally, this line:

UpdateRate=60

Seems a bit aggressive to me. Since you have the overall skin set to Update=1000 (update once a second) then setting WebParser to check your mail at an UpdateRate of 60 (60ms X 1000ms = once a minute) is going to use computer and network resources in a way that may not make sense. Nothing technically wrong with it, but do you really want to go out and check your mail every minute? I'd be tempted to make it 300 (5 minutes) or even 600 (10 minutes).
Chaoz
Posts: 19
Joined: May 28th, 2009, 12:15 am

Re: Need help regarding gmail skins

Chaoz » December 16th, 2010, 8:33 pm

So I guess this is a mystery then? Since no one can explain why it's showing messages for a different account...
User avatar
jsmorley
Developer
Posts: 19272
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need help regarding gmail skins

jsmorley » December 16th, 2010, 8:34 pm

Chaoz wrote:So I guess this is a mystery then? Since no one can explain why it's showing messages for a different account...
It's not.