LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Script to get number of unread messages in gmail (http://www.linuxquestions.org/questions/linux-software-2/script-to-get-number-of-unread-messages-in-gmail-676076/)

Geneset 10-13-2008 12:44 PM

Script to get number of unread messages in gmail
 
Afternoon gents, I've got myself another project.

But I'm trying to find a method of getting just the unread messages from a google mail account.

Any ideas?

Geneset 10-13-2008 02:39 PM

I tried with a perl module called WWW::Scraper::Gmail but something is screwy

WWW::Scraper::Gmail::countMail() just returns 0 when there are messages or 0 when there arnt. I'm assuming this is deprecated but i would have liked a more customisable interface.

Nobody else got any ideas?

Tobler 10-13-2008 02:54 PM

How about IMAP protocol in Gmail and fetchmail on your Linux?

~/.fetchmailrc:
poll imap.gmail.com with proto imap and options no dns
user "account@gmail.com" there is your-linux-account here options ssl keep pass your-gmail-password

Check mail without downloading and verbose option on:
fetchmail -c -v

br, Tobler

Geneset 10-13-2008 03:04 PM

I know, i was thinking that too, but i mean, thats really messy and inelegant :D

With perls extensability, web handling and xml processing, I'd hav thought that it would be a breeze. Guess not.
Thank you for your contribution.
Any other ideas?


All times are GMT -5. The time now is 05:33 PM.