Announcement

Collapse
No announcement yet.

Gmail - New Email Count - Label & Indicator

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gmail - New Email Count - Label & Indicator

    The W3bMa5t3r's Gmail New Email Counter and Indicator

    Ok this is a very simple program I wrote over the weekend. It does require an Internet connection, but that's a given since you're checking the status of your email account. Oh and this uses Internet Explorer (behind the scenes), so yeah, that's required too.

    This program will create a label "CUSTOM_GMAILCOUNT" that displays the current count of new emails in your account, and an indicator "CUSTOM_NEW_GMAIL" which will allow you to show an icon when there are new messages.

    STOLEN FROM MY SKIN:

    Code:
    Label Code
     
    L,381,501,30,20,255,255,255,10,"Arial:B","CUSTOM_GMAILCOUNT","RIGHT"
     
    Indicator Code
     
    I,411,492,30,32,"CUSTOM_NEW_GMAIL"
    You must edit the "config.ini" file to enter your Gmail username and password.
    For slower systems or who need to save bandwidth, you can set the polling speed in the "config.ini" file. Value is in Milliseconds, 1000 = 1 Second. Set the "pause_key=" variable in "config.ini" to set your own hotkey. The "config.ini" file needs to stay with the "GmailCount.exe" program for proper operation.

    As far as use goes, you can have it load from the "Command to execute" in RoadRunner config, by a button using the "RUN;GmailCount.exe" code, or whatever else floats your boat and works for you. Also, if you just run this program, it will start RoadRunner for you, but if you already have a preconfigured startup for your RoadRunner setup you might not want to do it that way... so it's up to you

    Oh and since it had been mentioned before, best I can tell, that even though this is constantly running, there is a very low cpu hit.

    Here's a screenshot of the count and indicator working in my newest skin.



    Let me know if you encounter any errors or would like something changed/add/etc...

    Cheers,
    The W3bMa5t3r

    -=[ GET IT HERE ]=-

    VERSION 1.3
    • Fixed the code because if emails were read, the indicator wouldn't go away.
    • Added a function to refresh the count faster than what the web page would by itself.
    • Added an additional line in the "config.ini" file to set the polling speed. Useful for slower systems or those needing to conserve bandwidth. Set in Milliseconds, 1000 = 1 Second
    • Added tray icons that also change status if there are new emails or not.
    • Allowed decompiling of code for those who wish to see the code.
    VERSION 1.4
    • Added a quick ping at the beginning of the program as I noticed that sometimes it wasn't working on my system if I rebuilt the program and for some reason the firewall wouldn't notify me that GmailCount.exe was trying to get through. This ping ensures it does.
    • Created program icon so it's somewhat distinguishable from other AutoIt programs.
    VERSION 1.5
    • Added a Global Hotkey so you can pause the program if you're needing to type, as the way this program functions, it temporarily steals focus as it updates. The default is "^!p" (Ctrl+Alt+P). Set the "pause_key=" variable in "config.ini" to set your own hotkey.
    • Added an additional trayicon that displays a paused state while the program is paused. Clears once you've resumed the program.

  • #2
    great work, thank you!
    2002 Acura RSX CarPC Worklog
    Current CarPC Expenses

    Comment


    • #3
      this isnt working for me steve. I'm not gettin any errors but i have new mail in my gmails account but neither the label (CUSTOM_GMAILCOUNT) or indicator (CUSTOM_NEW_GMAIL) are showing up. I tried in flash and non flash skins. the username needs to be just the prefix of the email account or is the the full email address?
      mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
      Follow Me on Twitter or Facebook
      Live mp3Car Facebook Chat

      Comment


      • #4
        Originally posted by Sonicxtacy02 View Post
        this isnt working for me steve. I'm not gettin any errors but i have new mail in my gmails account but neither the label (CUSTOM_GMAILCOUNT) or indicator (CUSTOM_NEW_GMAIL) are showing up. I tried in flash and non flash skins. the username needs to be just the prefix of the email account or is the the full email address?
        The username is just the prefix of your email account.
        i.e.
        Code:
        [email protected] would be DCCARPCS
        If you open IE alone and log into Gmail, are you getting the new email count in the browser titlebar? /edit - got your answer - yes

        Comment


        • #5
          Anyone else try this? Results?

          Comment


          • #6
            Since you dropped me a message about this this weekend I'll give it a run when i get home. Did you fix the problem we were discussing?

            Comment


            • #7
              Originally posted by 1Munkey View Post
              Since you dropped me a message about this this weekend I'll give it a run when i get home. Did you fix the problem we were discussing?
              Cool thanks and yes I did.

              Comment


              • #8
                It didn't crash! Haha. Well the first time i tried it it went into a never ending script pause but I think it had something to do with me opening it first, it opening RR and then trying to find my data for the first time. I couldn't replicate the error so I dunno why that happened. Anyways, when I reloaded it I was able to get it to throw up my count and the indicator. Screwing around with my unread messages, it didn't refresh very well. I'm not sure how often you poll and refresh (and I can't check since you put a passphrase to hide from my peering eyes ) but why don't you crank it up a bunch (and I'm talking like every 5-10 seconds) and let's give it a ride.

                Comment


                • #9
                  Originally posted by 1Munkey View Post
                  It didn't crash! Haha. Well the first time i tried it it went into a never ending script pause but I think it had something to do with me opening it first, it opening RR and then trying to find my data for the first time. I couldn't replicate the error so I dunno why that happened. Anyways, when I reloaded it I was able to get it to throw up my count and the indicator. Screwing around with my unread messages, it didn't refresh very well. I'm not sure how often you poll and refresh (and I can't check since you put a passphrase to hide from my peering eyes ) but why don't you crank it up a bunch (and I'm talking like every 5-10 seconds) and let's give it a ride.
                  Glad it's not crashing on you There aren't any sleep or poll limits, so it's polling as fast as it can read your account and update RR and do it all over again. Now one thing, it's using an IE browser in the background, and the default page refresh for the Gmail Inbox can be kinda slow, so that might be what's holding it up. I'll see about forcing a refresh to make it faster. So far CPU usage is next to nill (at least on my system) so that shouldn't hurt anything.
                  I didn't passphrase it.. lol somehow I unchecked the allow decompile. I'm about to release an updated version with tray icons, etc... so I'll change that too so you can check out my sloppy work LOL

                  Comment


                  • #10
                    Awesome. I'd love to see what professional programmers call "sloppy code". We get all self-conscious about our custom apps for custom hardware that run with near zero footprint while I can't count how much crap I've broke throwing things in disguist with "professional" programs.

                    How has the app been running on your comp? Are you getting it to refresh pretty quick. I've tried a few different scenarios with and without gmail running and can't get any consistency in a reload.

                    Let me know when you throw out a new release.

                    Comment


                    • #11
                      Version 1.4 Has Been Released - See First Post

                      Comment


                      • #12
                        Originally posted by 1Munkey View Post
                        Awesome. I'd love to see what professional programmers call "sloppy code". We get all self-conscious about our custom apps for custom hardware that run with near zero footprint while I can't count how much crap I've broke throwing things in disguist with "professional" programs.

                        How has the app been running on your comp? Are you getting it to refresh pretty quick. I've tried a few different scenarios with and without gmail running and can't get any consistency in a reload.

                        Let me know when you throw out a new release.
                        Professional programmer? hardly. This is my first bit of code that actually interacts with another program. The only other thing I've really built is my own little NetDetect program. And it's actually quite similar to many other programs on this site. lol.

                        The app is running great now. Updates the count and indicators almost as soon as the email count is changed, up or down or all read. There will be a slight consistency issue as it's reloading the webpage, so if the site is slow, the connect is used by something else, or many other things, it can vary. But with the force reload, it should be more consistent now You don't need Gmail to be running elsewhere, as the program does it in the background.

                        Comment


                        • #13
                          newest version worked for me.... after about 5 mins. Better late than never tho! Thanks steve
                          mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                          Follow Me on Twitter or Facebook
                          Live mp3Car Facebook Chat

                          Comment


                          • #14
                            Originally posted by Sonicxtacy02 View Post
                            newest version worked for me.... after about 5 mins. Better late than never tho! Thanks steve
                            Glad it's working for you now. Any indication as why it's slow to update on your setup? Here at the house I have it setup with 0 for the polling. It's updating as fast as the page can reload. How's it look on your cpu processes?

                            Comment


                            • #15
                              The CPU will go between 0-6% usually 0-3% with 6,548K of mem. Can't figure out why it doesn't want to update sometimes. It looks to me like it's running every second but it updates when it wants to. I've also seen the indicator without any number in the label. Haven't seen the label without an indicator though. What version of RR are you running? I'm running the 2/7/07 version.

                              Comment

                              Working...
                              X