def __init__(self, input_file): dom = etree.parse(input_file) doc = dom.xpath("/response/result/doc")[0] self.id = get_solr_str(doc, 'id') self.type = get_solr_str(doc, 'job_type') self.title = get_solr_str(doc, 'job_title') self.company = get_solr_str(doc, 'job_company') self.location = get_solr_str(doc, 'job_location') self.description = get_solr_str(doc, 'job_description') self.min_salary = get_solr_str(doc, 'salary_bracket_min') self.max_salary = get_solr_str(doc, 'salary_bracket_max')
def __init__(self, input_file): dom = etree.parse(input_file) doc = dom.xpath("/response/result/doc")[0] self.id = get_solr_str(doc, 'user_id') self.first_name = get_solr_str(doc, 'user_first_name') self.last_name = get_solr_str(doc, 'user_last_name') self.locations = get_solr_str(doc, 'user_locations') self.resume = get_solr_arr(doc, 'content') self.summary = get_solr_str(doc, 'linkedin_summary') self.score = 0 positions = loads(get_solr_str(doc, 'linkedin_positions'))['values'] self.positions = map(lambda x: Position(x), positions) skills = loads(get_solr_str(doc, 'linkedin_skills'))['values'] # Nothing to do with endorsements yet, so this should be okay? # If we get endorsements this should probably be wrapped in a class # so we can count them etc. self.skills = map(lambda x: x['skill']['name'], skills)