Subversion Repositories SmartDukaan

Rev

Rev 16733 | Rev 16735 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16733 Rev 16734
Line 35... Line 35...
35
    offer_url =  AFFILIATE_OFFER_API.get(AFFILIATE_ID)%(DEVICE_ID,RETAILER_CODE)
35
    offer_url =  AFFILIATE_OFFER_API.get(AFFILIATE_ID)%(DEVICE_ID,RETAILER_CODE)
36
    response = fetchResponseUsingProxy(offer_url, proxy=False)
36
    response = fetchResponseUsingProxy(offer_url, proxy=False)
37
    input_json = json.loads(response)
37
    input_json = json.loads(response)
38
    if input_json['status'].strip()=='ok' and input_json['message'] =="Success":
38
    if input_json['status'].strip()=='ok' and input_json['message'] =="Success":
39
        offers = (input_json['payload'])['offers']
39
        offers = (input_json['payload'])['offers']
-
 
40
        if offers is not None and len(offers) >0:
40
        for offer in offers:
41
            for offer in offers:
41
            ACTIVE_OFFERS.append(str(offer['offerId']))
42
                ACTIVE_OFFERS.append(str(offer['offerId']))
42
        
-
 
43
        print ACTIVE_OFFERS
-
 
44
            
43
            
-
 
44
            print ACTIVE_OFFERS
-
 
45
                
45
        for offer in offers:
46
            for offer in offers:
46
            fetchOfferDescriptionAndDump(offer)
47
                fetchOfferDescriptionAndDump(offer)
47
    
48
    
48
    
49
    
49
def fetchOfferDescriptionAndDump(offer):
50
def fetchOfferDescriptionAndDump(offer):
50
    offer_desc_url = AFFILIATE_OFFER_DESC_API.get(AFFILIATE_ID)%(DEVICE_ID,offer['offerId'],RETAILER_CODE)
51
    offer_desc_url = AFFILIATE_OFFER_DESC_API.get(AFFILIATE_ID)%(DEVICE_ID,offer['offerId'],RETAILER_CODE)
51
    response = fetchResponseUsingProxy(offer_desc_url,proxy=False)
52
    response = fetchResponseUsingProxy(offer_desc_url,proxy=False)