Subversion Repositories SmartDukaan

Rev

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

Rev 17233 Rev 17267
Line 37... Line 37...
37
            'Connection':'keep-alive',
37
            'Connection':'keep-alive',
38
            'Accept-Encoding' : 'gzip,deflate,sdch'
38
            'Accept-Encoding' : 'gzip,deflate,sdch'
39
        }
39
        }
40
PROXY_MESH_LIVE = "us.proxymesh.com:31280"
40
PROXY_MESH_LIVE = "us.proxymesh.com:31280"
41
PROXY_MESH_GENERAL = "us-il.proxymesh.com:31280"
41
PROXY_MESH_GENERAL = "us-il.proxymesh.com:31280"
-
 
42
PROXY_FLIPKART = "14.139.172.170:3128"
42
 
43
 
43
PUSH_NOTIFICATION_URL='http://api.profittill.com/admin/users/push'
44
PUSH_NOTIFICATION_URL='http://api.profittill.com/admin/users/push'
44
DTR_API_BASIC_AUTH = base64.encodestring('%s:%s' % ("dtr", "dtr18Feb2015")).replace('\n', '')
45
DTR_API_BASIC_AUTH = base64.encodestring('%s:%s' % ("dtr", "dtr18Feb2015")).replace('\n', '')
45
statusMap = {1:'Active',2:'EOL',3:'In Process',4:'Exclusive'}
46
statusMap = {1:'Active',2:'EOL',3:'In Process',4:'Exclusive'}
46
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5,'PAYTM.COM':6, 'HOMESHOP18.COM':7}
47
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5,'PAYTM.COM':6, 'HOMESHOP18.COM':7}
Line 144... Line 145...
144
        gz.close()
145
        gz.close()
145
        return html
146
        return html
146
    return r.read()
147
    return r.read()
147
 
148
 
148
 
149
 
149
def fetchResponseUsingProxy(url, headers=headers, livePricing=None, proxy=True):
150
def fetchResponseUsingProxy(url, headers=headers, livePricing=None, proxy=True, flipkart=False):
150
    if livePricing is None:
151
    if livePricing is None:
151
        PROXY_URL = PROXY_MESH_GENERAL
152
        PROXY_URL = PROXY_MESH_GENERAL
-
 
153
    elif flipkart:
-
 
154
        PROXY_URL = PROXY_FLIPKART
152
    else:
155
    else:
153
        PROXY_URL = PROXY_MESH_LIVE
156
        PROXY_URL = PROXY_MESH_LIVE
154
    if proxy:
157
    if proxy:
155
        print PROXY_URL
158
        print PROXY_URL
156
        proxy = urllib2.ProxyHandler({'http': PROXY_URL})
159
        proxy = urllib2.ProxyHandler({'http': PROXY_URL})