def __init__(self, source_definition): super(GegevensmagazijnBaseExtractor, self).__init__(source_definition=source_definition) user, password = get_secret(self.source_definition['id']) self.http_session.headers['Authorization'] = 'Basic %s' % b64encode( '%s:%s' % (user, password)) self.feed_url = self.source_definition['base_url'] + \ self.source_definition['feed_query']
def run(self, *args, **kwargs): item = args[0] user, password = get_secret(kwargs['source_definition']['id']) self.http_session.headers['Authorization'] = 'Basic %s' % b64encode( '%s:%s' % (user, password)) self.http_session.headers[ 'Accept'] = 'application/xml; charset="utf-8"' resp = self.http_session.get(item) return 'application/xml', resp.content
def __init__(self, source_definition): super(GegevensmagazijnBaseExtractor, self).__init__(source_definition=source_definition) user, password = get_secret(self.source_definition['id']) self.http_session.headers['Authorization'] = 'Basic %s' % b64encode( '%s:%s' % (user, password)) self.feed_url = self.source_definition[ 'base_url'] + self.source_definition['feed_query'] self.redis = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=1)
def __init__(self, source_definition): super(GegevensmagazijnBaseExtractor, self).__init__(source_definition=source_definition) user, password = get_secret(self.source_definition['id']) self.http_session.headers['Authorization'] = 'Basic %s' % b64encode('%s:%s' % (user, password)) self.feed_url = self.source_definition['base_url'] + self.source_definition['feed_query'] self.redis = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=1)
def setup_http_auth(self): user, password = get_secret(self.source_definition['id']) self.http_session.headers['Authorization'] = 'Basic %s' % b64encode( '%s:%s' % (user, password))