Exemple #1
0
 def build_profile(response):
     response = response['results'][0]
     name = build_full_name(response.get('first_name'), response.get('last_name'))
     profile_link = self.profile_link(response.get('login_name'))
     return Profile(
         name=name,
         profile_picture_link=response.get('image_url_75x75'),
         profile_link=profile_link,
         bio=response.get('bio'),
         username=response.get('login_name'),
         gender=response.get('gender'),
     )
Exemple #2
0
 def build_profile(response):
     user = response.get("response", {}).get("user", {})
     name = build_full_name(user.get("firstName"), user.get("lastName"))
     profile_picture_link = None
     if user.get("photo"):
         profile_picture_link = "%s100x100%s" % (user["photo"].get("prefix"), user["photo"].get("suffix"))
     return Profile(
         name=name,
         email=user.get("contact", {}).get("email"),
         bio=user.get("bio"),
         gender=user.get("gender"),
         profile_picture_link=profile_picture_link,
         profile_link="https://foursquare.com/user/%s" % kwargs["authorization"].user_id,
         username=None,
     )
Exemple #3
0
        def build_profile(data):
            name = build_full_name(data.get('firstName'), data.get('lastName'))

            # LinkedIn doesn't provide a username. This only will be available
            # if the user has made their profile public.
            username = None
            match = re.match(r'.*/in/(.*)$', data.get('publicProfileUrl'))
            if match:
                username = match.group(1)
            return Profile(
                bio=data.get('summary'),
                first_name=data.get('firstName'),
                headline=data.get('headline'),
                last_name=data.get('lastName'),
                maiden_name=data.get('maidenName'),
                name=name,
                profile_link=data.get('publicProfileUrl'),
                profile_picture_link=data.get('pictureUrl'),
                username=username,
            )