Skip to content

Instantly share code, notes, and snippets.

@mdrcode
Created August 20, 2012 20:36
Show Gist options
  • Save mdrcode/3407647 to your computer and use it in GitHub Desktop.
Save mdrcode/3407647 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import getpass
import os
import sys
import mobileworks as mw
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 the local
store where you shop.
"""
fields = [
("Your First Name", "t"),
("Your City", "t"),
("Your Country", "t"),
("Your Local Store (Market, Grocery, etc)", "t"),
("Address of your local store", "t"),
]
proj = mw.Project(instructions=instr)
proj.set_params(workflow='s')
proj.set_params(redundancy=1)
for i in range(100):
proj.add_task(mw.Task())
for (label, type) in fields:
proj.add_field(label, type)
proj_url = proj.post()
print proj_url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment