Quote from: falldown on February 09, 2013, 10:25:14 PMYes for sure you can! It is not mine however, this is the result of some *borrowing* off VastOne. (i.e., that was my source!) It will only work to check your gmail.
Jed can I get a copy of your email script (gmail and VSIDO).?.
The python script;
gmail_parser.py
Code Select
## check-gmail.py -- A command line util to check GMail -*- Python -*-
## modified to display mailbox summary for conky
# ======================================================================
# Copyright (C) 2006 Baishampayan Ghose <b.ghose@ubuntu.com>
# Modified 2008 Hunter Loftis <hbloftis@uncc.edu>
# Time-stamp: Mon Jul 31, 2006 20:45+0530
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
# ======================================================================
import sys
import urllib # For BasicHTTPAuthentication
import feedparser # For parsing the feed
from textwrap import fill
_URL = "https://mail.google.com/gmail/feed/atom"
uname = sys.argv[1]
password = sys.argv[2]
maxlen = sys.argv[3]
urllib.FancyURLopener.prompt_user_passwd = lambda self, host, realm: (uname, password)
def auth():
'''The method to do HTTPBasicAuthentication'''
opener = urllib.FancyURLopener()
f = opener.open(_URL)
feed = f.read()
return feed
def readmail(feed, maxlen):
'''Parse the Atom feed and print a summary'''
atom = feedparser.parse(feed)
print '${color grey} %s new email(s)\n' % (len(atom.entries))
for i in range(min(len(atom.entries), maxlen)):
print '${color grey}%s' % fill(atom.entries[i].title,38)
#uncomment the following line if you want to show the name of the sender
# print ' ${color2}%s' % atom.entries[i].author
if len(atom.entries) > maxlen:
print ' ${color}more...'
if __name__ == "__main__":
f = auth() # Do auth and then get the feed
readmail(f, int(maxlen)) # Let the feed be chewed by feedparser
The Conky additions to make after the "Text";
Code Select
TEXT
${color 547EC8}${time %l:%M}${time %P}
${color 547EC8}${time %a %b %d %Y}
${color 547EC8}Jed - ${execpi 15 python ~/gmail_parser.py yourgmail@gmail.com yourpasswd 3}
${color 547EC8}VSIDO Community - ${execpi 15 python ~/gmail_parser.py yourgmail@gmail.com yourpasswd 3}