MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

Status coming back blank

Last post 07-08-2009 6:38 PM by Kiam. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-26-2009 7:21 PM

    • Casidy
    • Not Ranked
    • Joined on 05-01-2009
    • Posts 6

    Status coming back blank

    I am using the opensocial php client and I am trying to get a users status. I tried the example code that comes with the client (seen below), but it keeps giving me a blank status. I set the status a couple of days ago, so I know it isn't blank. I've been able to get different details about the user so I know that everything isn't coming back blank. Does anyone have any ideas??? Thanks!
    
        try {
    	$batch = $this->myspace->newBatch();
    	// Fetch the current user.
    	$self_request_params = array(
    		'userId' => $this->ms_user_id,           // Person we are fetching.
    		'groupId' => '@self',              // @self for one person.
    		'fields' => array('status')        // Which profile fields to request.
    	);
    	$batch->add($this->myspace->people->get($self_request_params), 'self');
    	$result = $batch->execute();
    	
            //put the field names as keys in an array
    	foreach ($result as $key => $result_item) {} 
        if ($result_item instanceof osapiError) {
          $code = $result_item->getErrorCode();
          $message = $result_item->getErrorMessage();
          echo 'There was a $code error with the $key request:';
          echo htmlentities($message);
        } else {
    
          echo 'Response for the $key request:';
          echo htmlentities(print_r($result_item, True));
        }
    		return $result_item->status;
    	
    	} catch (Exception $e) {
    		return false;
    	}
    
    Filed under: , ,
  • 07-08-2009 6:38 PM In reply to

    • Kiam
    • Top 50 Contributor
    • Joined on 02-19-2009
    • Posts 62
    • MDP Team

    Re: Status coming back blank

    I will let you know when our php sdk supports onsite apps -- which will solve your problem.
    Follow us on twitter for major updates and announcements:

    http://twitter.com/MySpaceDevTeam

    Friend the MDP Profile!
    http://profile.myspace.com/index.cfm?fuseaction=user.viewProfile&friendID=295946135
Page 1 of 1 (2 items)