Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from twill.commands import *
- from slacker import Slacker
- URL = 'https://certmetrics.com/juniper'
- username = 'XXXXXXXXXX'
- password = 'XXXXXXXXXX'
- def login():
- print 'filling forms'
- fv('1', 'ctl00$mainContent$txtLoginCandidateLoginID', username)
- fv('1', 'ctl00$mainContent$txtLoginCandidatePass', password)
- print 'correcting form'
- formaction('1', 'https://www.certmetrics.com/juniper/login.aspx?ReturnUrl=%2fjuniper?')
- print 'submitting...'
- submit()
- def checkforcert():
- while True:
- print 'checking exam page'
- go('https://www.certmetrics.com/juniper/candidate/requirements.aspx')
- result = show()
- if 'JNCIE-DC' in result:
- print 'JNCIE-DC result found!'
- post_slack()
- break
- else:
- print 'nothing found; sleeping 120 seconds...'
- time.sleep(120)
- def post_slack():
- slack = Slacker('xoxp-136198617350-135519103730-161152603600-f712236f6d7791c8c1588d192b48510a')
- response = slack.users.list()
- slack.chat.post_message('#general', '@mtucker502: certmetrics has JNCIE-DC on the exam page!!!!')
- def main():
- print 'Opening main page...'
- go('https://certmetrics.com/juniper')
- #TODO check to see if login is needed
- login()
- checkforcert()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement