Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - install python 2.X
- - donwload dependencies
- https://github.com/kennethreitz/requests
- https://github.com/saippuakauppias/temp-mail
- https://pypi.python.org/pypi/fake-factory#downloads
- - unzip the 3 folders
- - run these commands:
- python {folder}\kennethreitz-request\setup.py install
- python {folder}\temp-mail\setup.py install
- python {folder}\fake-factory\setup.py install
- - copy the script into a file boy.py
- - run python bot.py
- (THIS IS NOT THE POPE VERSION)
- #!/usr/bin/env python
- import tempmail
- import mechanize, time, re
- import random, string
- from faker import Factory
- def doit():
- print 'Generating TempMail...'
- tm = tempmail.TempMail()
- email = tm.get_email_address()
- url = 'https://petition.parliament.uk/petitions/131215/signatures/new'
- fake = Factory.create('en_GB')
- name = fake.name()
- postcode = fake.postcode()
- print 'Signing as %s / %s (%s)' % (name, email, postcode)
- br = mechanize.Browser()
- br.set_handle_robots(False)
- br.open(url)
- br.form = list(br.forms())[0]
- c = br.form.find_control(type="checkbox")
- c.value = ['1']
- br.form['signature[name]'] = name
- br.form['signature[email]'] = email
- br.form['signature[location_code]'] = ['VA']
- br.form['signature[postcode]'] = postcode
- response = br.submit()
- html = response.read()
- #with open('temp.html', 'w') as f: f.write(html)
- badness = [
- "Postcode not recognised",
- "disposable email address"
- ]
- for x in badness:
- if x in html:
- print x
- print 'Fuck.'
- exit()
- br.form = list(br.forms())[0]
- print 'Confirming...'
- response = br.submit()
- html = response.read()
- while True:
- print 'Checking mail...'
- mb = tm.get_mailbox(email)
- if not 'error' in mb:
- html = mb[0]['mail_html']
- url = re.search('<p><a href="(.*?)">', html).group(1)
- break
- time.sleep(1)
- print 'Validating %s' % url
- response = mechanize.urlopen(url)
- html = response.read()
- #with open('temp2.html', 'w') as f: f.write(html)
- sigs = re.search('<h1 class="visuallyhidden">(.*?) signatures</h1>', html).group(1)
- print '%s total signatures' % sigs
- while True:
- doit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement