Advertisement
herangr

conky gmail

Jan 20th, 2012
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import os
  4.  
  5. #Enter your domain, username and password below within double quotes
  6. # eg. domain="yourdomain.com", username="username" and password="password"
  7. domain="gmail.com"
  8. username="_____________"
  9. password="_____________"
  10. com="wget -q -O - https://mail.google.com/a/"+domain+"/feed/atom --http-user="+username+"@"+domain+" --http-password="+password+" --no-check-certificate"
  11.  
  12. temp=os.popen(com)
  13. msg=temp.read()
  14. index=msg.find("<fullcount>")
  15. index2=msg.find("</fullcount>")
  16. fc=int(msg[index+11:index2])
  17. if fc==0:
  18.    print ("0 new")
  19. else:
  20.    print (str(fc)+" new")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement