def send_requests(): request_list = [ api.offer_open(renderer, guid, engagement, email=email, position=1), api.offer_open(renderer, guid, engagement, email=email, position=2), api.offer_open(renderer, guid, engagement, email=email, position=3), api.offer_open(renderer, guid, engagement, email=email, position=4), api.offer_click(click, guid, engagement, email=email, position=1), ] for request in request_list: response = requests.get(request) if not response.raise_for_status(): if "cbtt=" in response.url: nonsense, cbtt = response.url.split("cbtt=") request_list_cbtt = [ api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id, cbtt=cbtt), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id), api.buy(advisor, username, password, aid, sku, cookie_id=cookie_id) ] for request in request_list_cbtt: requests.get(request).raise_for_status()
def send_requests(): request_list = [ api.offer_open(renderer, guid, engagement, cookie_id=cookie_id), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id), api.buy(advisor, username, password, aid, sku, cookie_id=cookie_id) ] for request in request_list: requests.get(request).raise_for_status()
def send_requests(): # time stamp format "2016/09/07" || "YYYY/MM/DD" timestamp_with_delta = datetime.now() - timedelta( 1) # deducts 1 day from timestamp one_day_past = timestamp_with_delta.strftime( "%Y-%m-%d") # formats timestamp properly request_list = [ api.offer_open(renderer, guid, engagement, email=email, timestamp=one_day_past), api.login(advisor, username, password, aid, cookie_id=cookie_id, email=email), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id), api.buy(advisor, username, password, aid, sku, cookie_id=cookie_id) ] for request in request_list: requests.get(request).raise_for_status()
def send_requests(): request_list = [ api.offer_open(renderer, guid, engagement, email=email, cookie_id=cookie_id), api.offer_click(click, guid, engagement, email=email, cookie_id=cookie_id_new), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id_new), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id_new), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id_new), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id_new), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id_new), api.buy(advisor, username, password, aid, sku, cookie_id=cookie_id_new) ] for request in request_list: requests.get(request)
def send_requests(): offer_open = api.offer_open(renderer, guid, engagement, email=email) request_list = [ api.login(advisor, username, password, aid, cookie_id=cookie_id, email=email), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id), api.buy(advisor, username, password, aid, sku, cookie_id=cookie_id) ] for i in range(220): requests.get(offer_open).raise_for_status() for request in request_list: requests.get(request).raise_for_status()
def send_requests(): request_list = [ api.login(advisor, username, password, aid, cookie_id=cookie_id, email=email), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id), api.buy(advisor, username, password, aid, sku, cookie_id=cookie_id) ] for request in request_list: requests.get(request).raise_for_status()
def send_requests(): # time stamp format "2016/09/07" || "YYYY/MM/DD" timestamp_with_delta = datetime.now() - timedelta( 3) # deducts 3 days from timestamp three_days_past = timestamp_with_delta.strftime( "%Y-%m-%d") # formats timestamp properly request_list = [ api.offer_open(renderer, guid, engagement, email=email, position=1, timestamp=three_days_past), api.offer_open(renderer, guid, engagement, email=email, position=2, timestamp=three_days_past), api.offer_open(renderer, guid, engagement, email=email, position=3, timestamp=three_days_past), api.offer_open(renderer, guid, engagement, email=email, position=4, timestamp=three_days_past), api.offer_click(click, guid, engagement, email=email, position=1, timestamp=three_days_past) ] for request in request_list: response = requests.get(request) if not response.raise_for_status(): if "cbtt=" in response.url: nonsense, cbtt = response.url.split("cbtt=") request_list_cbtt = [ api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id, cbtt=cbtt, timestamp=three_days_past), api.login(advisor, username, password, aid, cookie_id=cookie_id, email=email), api.browse(advisor, username, password, aid, sku, cookie_id=cookie_id), api.cart_add(advisor, username, password, aid, sku, cookie_id=cookie_id), api.buy(advisor, username, password, aid, sku, cookie_id=cookie_id) ] for request in request_list_cbtt: requests.get(request).raise_for_status()