Make request to Google API to get profile data for the user.
4589
def google_get_data(self, config, response):
        """"""
        params = {
            'access_token': response['access_token'],
        }
        payload = urlencode(params)
        url = self.google_api_url + 'userinfo?' + payload
        req = Request(url)
        json_str = urlopen(req).read()
        return json.loads(json_str.decode('utf-8'))
273134
function (req, res, next) {
    var accessToken = req.accessToken;
    var headers = { 'User-Agent': 'Satellizer' };
    var userApiUrl = 'https://api.github.com/user';

    request.get({ url: userApiUrl, qs: accessToken, headers: headers, json: true }, function(err, response, profile) {
      if (err) {
        res.status(500).send(err);
        return;
      }
      req.profile = profile;
      next();
    });
  }
18103
function getUFData(userName, identity, options, callback) {
			var url = 'http://lanyrd.com/people/' + userName,
				cache = options.cache,
				page =  new Page(url, identity, null, options);

			page.fetchUrl(function(){
				if(page.profile.hCards.length > 0){
					page.profile.hCards[0].source = 'microformat';	
					callback(null, page.profile.hCards[0]);
				}else{
					callback(null, {});
				}
			})
		}
326610
def get_user_stats(self, name):
        """"""

        req = self.conn.get(BASE_URL + "/user/" + name)
        if req.status_code != 200 or not name:
            return None

        return self.conn.make_api_call("getUserInfo", {"name": name})
841112
def user_data(self, access_token, *args, **kwargs):
        """"""

        return self.get_json(self.USER_INFO_URL, method="POST", headers=self._get_headers(access_token))
1364153
def get_basic_profile(self, user_id, scope='profile/public'):
        
        profile = _get(
            token=self.oauth.get_app_token(scope),
            uri='/user/profile/' + urllib.quote(user_id)
        )

        try:
            return json.loads(profile)
        except:
            raise MxitAPIException('Error parsing profile data')
182918
def details(self):
        """"""
        return self.dest_user.profile.details.convert_and_update(
            self.source_profile.details.as_dict
        )
222052
def get_session_data(self, request):
        
        user = request.session['%suser' % SESSION_KEY]
        profile = request.session['%sprofile' % SESSION_KEY]
        client = request.session['%sclient' % SESSION_KEY]
        return user, profile, client
888553
def _get_current_userprofile():
    
    if current_user.is_anonymous:
        return AnonymousUserProfile()

    profile = g.get(
        'userprofile',
        UserProfile.get_by_userid(current_user.get_id()))

    if profile is None:
        profile = UserProfile(user_id=int(current_user.get_id()))
        g.userprofile = profile
    return profile
984303
def profile(self, name):
        """"""
        self.selected_profile = self.profiles.get(name)
        return self.profiles.get(name)
601123
def me(cls, api=None):
        
        api = api if api else cls._API
        extra = {
            'resource': cls.__name__,
            'query': {}
        }
        logger.info('Fetching user information', extra=extra)
        user_data = api.get(cls._URL['me']).json()
        return User(api=api, **user_data)
262025
def __load_profile(self, profile, uuid, verbose):
        """"""

        def is_empty_profile(prf):
            return not (prf.name or prf.email or
                        prf.gender or prf.gender_acc or
                        prf.is_bot or prf.country_code)

        uid = api.unique_identities(self.db, uuid)[0]

        if profile:
            self.__create_profile(profile, uuid, verbose)
        elif is_empty_profile(uid.profile):
            self.__create_profile_from_identities(uid.identities, uuid, verbose)
        else:
            self.log("-- empty profile given for %s. Not updated" % uuid, verbose)
168950
def get_user(self, user_id, **params):
        """"""
        response = self._get('v2', 'users', user_id, params=params)
        return self._make_api_object(response, User)
1029545
def get_updates_view(request):
    """"""
    if not request.is_ajax():
        raise Http404

    if not request.user.is_authenticated():
        return HttpResponse(json.dumps(dict()),
                            content_type="application/json")

    try:
        user_profile = UserProfile.objects.get(user=request.user)
    except UserProfile.DoesNotExist:
        return HttpResponse(json.dumps(dict()),
                            content_type="application/json")

    response = dict()
    if request.user.is_superuser:
        num_of_profile_requests = ProfileRequest.objects.all().count()

        if num_of_profile_requests == 0:
            response['profile_requests_link'] = '''
                <span class="glyphicon glyphicon-inbox"></span>
                Profile Requests
            '''

        else:
            response['profile_requests_link'] = """
                <span title="{req_num} open profile request{mult}"
                    class="badge pull-right">{req_num}</span>
                <span class="glyphicon glyphicon-inbox"></span>
                Profile Requests
            """.format(
                req_num=num_of_profile_requests,
                mult='s' if num_of_profile_requests > 1 else '',
            )

    notification_count = request.user.notifications.unread().count()

    if notification_count == 0:
        response['notifications_link'] = '''
            <span class="glyphicon glyphicon-bell"></span>
            Notifications
        '''

        response['profile_dropdown_link'] = '''
            <span><span class="pull-right"><b class="caret"></b></span>
            <span class="glyphicon glyphicon-user"></span>
            {first_name}&nbsp;</span>
        '''.format(first_name=request.user.first_name)

    else:
        response['notifications_link'] = """
            <span title="{n_num} unread notification{mult}"
                class="badge pull-right">{n_num}</span>
            <span class="glyphicon glyphicon-bell"></span>
            Notifications
        """.format(
            n_num=notification_count,
            mult='s' if notification_count > 1 else '',
        )

        response['profile_dropdown_link'] = '''
            <span><span class="pull-right"><b class="caret"></b></span><span
            title="You have {n_num} unread notification{mult}."
            class="badge pull-right">{n_num}</span>
            <span class="glyphicon glyphicon-user"></span>
            {first_name}&nbsp;</span>
        '''.format(
            n_num=notification_count,
            mult='s' if notification_count > 1 else '',
            first_name=request.user.first_name,
        )

    req_dict = dict()
    for req_type in RequestType.objects.filter(enabled=True):
        open_reqs = Request.objects.filter(request_type=req_type,
                                          status=Request.OPEN)
        if not req_type.managers.filter(incumbent__user=request.user):
            open_reqs = open_reqs.exclude(
                ~Q(owner__user=request.user), private=True,
                )
        num_open = open_reqs.count()
        if num_open == 0:
            req_dict['{rtype}_requests_link'.format(rtype=req_type.url_name)] \
                = """
                    <span class="glyphicon glyphicon-{icon}"></span>
                    {name}
                """.format(
                    icon=req_type.glyphicon if req_type.glyphicon else 'inbox',
                    name=req_type.name
                )

        else:
            req_dict['{rtype}_requests_link'.format(rtype=req_type.url_name)] \
                = """
                    <span title="{num} open request{mult}"
                        class="badge pull-right">{num}</span>
                    <span class="glyphicon glyphicon-{icon}"></span>
                    {name}
                """.format(
                    num=num_open,
                    mult='s' if num_open > 1 else '',
                    icon=req_type.glyphicon if req_type.glyphicon else 'inbox',
                    name=req_type.name,
                )

    if req_dict.keys():
        response['requests_dict'] = req_dict

    request_pk_list = request.GET.get('request_pk_list', False)
    if request_pk_list:
        request_pk_list = request_pk_list.split(',')
        for request_pk in request_pk_list:
            try:
                req = Request.objects.get(pk=request_pk)
            except Request.DoesNotExist:
                continue

            response['vote_count_{pk}'.format(pk=req.pk)] = req.upvotes.all().count()

            list_string = 'vote_list_{pk}'.format(pk=request_pk)
            vote_string = 'in_votes_{pk}'.format(pk=request_pk)
            count_string = 'vote_count_{pk}'.format(pk=request_pk)
            response[list_string], response[vote_string], \
                response[count_string] = build_ajax_votes(
                    req,
                    user_profile
                )

    event_pk_list = request.GET.get('event_pk_list', False)
    if event_pk_list:
        event_pk_list = event_pk_list.split(',')
        for event_pk in event_pk_list:
            try:
                event = Event.objects.get(pk=event_pk)
            except Event.DoesNotExist:
                continue

            link_string = 'rsvp_link_{pk}'.format(pk=event.pk)
            list_string = 'rsvp_list_{pk}'.format(pk=event.pk)
            response[link_string], response[list_string] = build_ajax_rsvps(
                event,
                user_profile
            )

    thread_pk = request.GET.get('thread_pk', False)
    if thread_pk:
        try:
            thread = Thread.objects.get(pk=thread_pk)
        except Thread.DoesNotExist:
            pass
        else:
            response['following'] = user_profile in thread.followers.all()
            response['num_of_followers'] = thread.followers.all().count()

    return HttpResponse(json.dumps(response),
                        content_type="application/json")
1035745
def api_user(request, userPk, key=None, hproPk=None):
    """"""

    if not check_api_key(request, key, hproPk):
        return HttpResponseForbidden

    if settings.PIAPI_STANDALONE:
        if not settings.PIAPI_REALUSERS:
            user = generate_user(pk=userPk)
            if user is None:
                return HttpResponseNotFound()
        else:
            user = get_object_or_404(DUser, pk=userPk)

        hproject = None
    else:
        from users.models import TechUser

        user = get_object_or_404(TechUser, pk=userPk)

        (_, _, hproject) = getPlugItObject(hproPk)

        user.ebuio_member = hproject.isMemberRead(user)
        user.ebuio_admin = hproject.isMemberWrite(user)
        user.subscription_labels = _get_subscription_labels(user, hproject)

    retour = {}

    # Append properties for the user data
    for prop in settings.PIAPI_USERDATA:
        if hasattr(user, prop):
            retour[prop] = getattr(user, prop)

    retour['id'] = str(retour['pk'])

    # Append the users organisation and access levels
    orgas = {}
    if user:
        limitedOrgas = []

        if hproject and hproject.plugItLimitOrgaJoinable:
            # Get List of Plugit Available Orgas first
            projectOrgaIds = hproject.plugItOrgaJoinable.order_by('name').values_list('pk', flat=True)
            for (orga, isAdmin) in user.getOrgas(distinct=True):
                if orga.pk in projectOrgaIds:
                    limitedOrgas.append((orga, isAdmin))
        elif hasattr(user, 'getOrgas'):
            limitedOrgas = user.getOrgas(distinct=True)

        # Create List
        orgas = [{'id': orga.pk, 'name': orga.name, 'codops': orga.ebu_codops, 'is_admin': isAdmin} for (orga, isAdmin)
                 in limitedOrgas]
    retour['orgas'] = orgas

    return HttpResponse(json.dumps(retour), content_type="application/json")
385026
function GetUserData(callback)
	{
		Log("Fetching user profile data");

		// get the current user's data
		parent.Get("https://vl.api.np.km.playstation.net/vl/api/v1/mobile/users/me/info", {}, function(error, data)
		{
			if (error)
			{
				Log("Error fetching user profile: " + error);
				if (callback) callback("Error fetching user profile: " + error);
				return;
			}

			if (!data.onlineId)
			{
				Log("Missing PSNId from profile result: " + JSON.stringify(data, null, 2));
				if (callback) callback("Missing PSNId from profile result: " + JSON.stringify(data, null, 2));
				return;
			}

			// store user ID
			Log("We're logged in as " + data.onlineId);
			auth_obj.username = data.onlineId;
			// store user's region too
			auth_obj.region = 	data.region;

			// save updated data object
			DoSave(function()
				{
					// return no error
					if (callback) callback(false);
				}
			);
			// supply self to let API know we are a token fetch function
		}, GetUserData);
	}
495925
def user_requests(self, id, **kwargs):
        ""
        api_path = "/api/v2/users/{id}/requests.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)