Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import getpass
- import os
- import sys
- import mobileworks as mw
- blocked_workers = ['138-897-73105', '5454-4963-404484', '3083-2592-211248']
- mw.username = 'mdrcode'
- if "MWPASS" in os.environ:
- mw.password = os.environ["MWPASS"]
- else:
- mw.password = getpass.getpass("MobileWorks password? ")
- mw.sandbox()
- if len(sys.argv) > 1 and sys.argv[1] == "prod":
- mw.production()
- instr = """
- Please enter basic information about yourself, your location, and your mobile
- phone.
- """
- fields = [
- ("Your First Name", "t"),
- ("Your City", "t"),
- ("Your Country", "t"),
- ("Your mobile phone? (iPhone, Android, Nokia, etc)", "t"),
- ("Do you have access to mobile data?", "t"),
- ]
- t = mw.Task(instructions=instr)
- for (label, type) in fields:
- t.add_field(label, type)
- t.set_params(location=['ID'])
- t.set_params(blocked=blocked_workers)
- t.set_params(workflow='s')
- t.set_params(payment=5)
- t.set_params(redundancy=100)
- task_url = t.post()
- print task_url
Add Comment
Please, Sign In to add comment