Guest User

Untitled

a guest
Dec 11th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import getpass
  4. import os
  5. import sys
  6. import mobileworks as mw
  7.  
  8. blocked_workers = ['138-897-73105', '5454-4963-404484', '3083-2592-211248']
  9.  
  10. mw.username = 'mdrcode'
  11.  
  12. if "MWPASS" in os.environ:
  13. mw.password = os.environ["MWPASS"]
  14. else:
  15. mw.password = getpass.getpass("MobileWorks password? ")
  16.  
  17. mw.sandbox()
  18.  
  19. if len(sys.argv) > 1 and sys.argv[1] == "prod":
  20. mw.production()
  21.  
  22. instr = """
  23. Please enter basic information about yourself, your location, and your mobile
  24. phone.
  25. """
  26.  
  27. fields = [
  28. ("Your First Name", "t"),
  29. ("Your City", "t"),
  30. ("Your Country", "t"),
  31. ("Your mobile phone? (iPhone, Android, Nokia, etc)", "t"),
  32. ("Do you have access to mobile data?", "t"),
  33. ]
  34.  
  35. t = mw.Task(instructions=instr)
  36.  
  37. for (label, type) in fields:
  38. t.add_field(label, type)
  39.  
  40. t.set_params(location=['ID'])
  41.  
  42. t.set_params(blocked=blocked_workers)
  43. t.set_params(workflow='s')
  44. t.set_params(payment=5)
  45. t.set_params(redundancy=100)
  46.  
  47. task_url = t.post()
  48.  
  49. print task_url
Add Comment
Please, Sign In to add comment