You are not logged in.

#1 2010-07-03 20:22:39

mirhciulica
Member
From: Romania
Registered: 2009-09-23
Posts: 13

Script to show new mails for standard Yahoo account

Hey all

I want to share a self made python script that shows the number of new emails from a standard Yahoo account (no Plus). I made it mostly for Conky big_smile.
It's only dependency is zope.testbrowser package from PyPI. You can install it with easy_install.

 
#!/usr/bin/env python

import string
from zope.testbrowser.browser import Browser

username = 'yourU'
password = 'yourP'
url = 'http://m.yahoo.com/w/ygo-mail/home.bp?.intl=EN&.lang=EN'

browser = Browser(url)
form = browser.getForm(id='LoginModel')
form.getControl(name='id').value = username
form.getControl(name='password').value = password
form.submit('Sign in')
temp = browser.contents
index=string.find(temp,'Inbox (')
index2=string.find(temp,')</font>')
try:
    print str(int(temp[index+7:index2]))
except:
    print '0'

Soon, I'll make an AUR package.
I think it's kind of insecure, but if you know any way to make it more reliable, please let me know.
I would appreciate any comments (this is my first script that goes to the community).

Cheers,
Mirhciulica

Offline

#2 2010-07-03 22:57:42

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: Script to show new mails for standard Yahoo account

Looks fine to me. smile Unfortunately, I use gmail.

Offline

Board footer

Powered by FluxBB