MySpace Open Platform

A Place For Developers

Welcome Developers!

in

Welcome!

in

PHP Client Library

Last post 11-05-2009 2:18 AM by sandy. 133 replies.
Page 2 of 9 (134 items) < Previous 1 2 3 4 5 Next > ... Last »
Sort Posts: Previous Next
  • 02-14-2008 7:49 AM In reply to

    • CC
    • Top 200 Contributor
    • Joined on 02-08-2008
    • Posts 25

    Re: PHP Client Library

    Hi,

    Can somebody post example on how to use this client library.

     

  • 02-15-2008 11:11 AM In reply to

    • Buzz
    • Top 75 Contributor
    • Joined on 02-07-2008
    • Posts 49

    Re: PHP Client Library

    There is an example at the top of the libary.
  • 02-18-2008 8:16 AM In reply to

    • Brad
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 1

    Re: PHP Client Library

    Buzz:
    There is an example at the top of the libary.

    I was wondering if there were any examples as well.  I checked the top of the library, and the only code that I saw was this:

      require_once('Space.php');
      $key = 'http://www.myspace.com/xxxxx';
      $secret = 'xxxxxxxxxxx';
      $s = new Space($key,$secret);
      $hProfile = $s->profile(1234567890);

     Does anyone have a little more in depth quick and dirty example of how to implement this? (IE: steps to take, example files, example source code to copy and paste in canvas, home, and profile surface code areas, etc..)

  • 02-19-2008 9:55 AM In reply to

    • Kim
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 7

    Re: PHP Client Library

     That's pretty much it.  Replace the xxxx's with your appl's info, then do a var_dump on $hProfile and see what you get.

  • 02-20-2008 7:58 AM In reply to

    Re: PHP Client Library

    Hi Jerome, great job, i found some bugs in the source code. 

    In the File Space.php  Line 63 in the method friends

    the correct code is

    if( $page_size !== null ) {
    $hParams['page_size'] = $page_size;
    }

    if( $list !== null ) {
    $hParams['list'] = $list;
    }

     

  • 02-20-2008 11:29 AM In reply to

    Re: PHP Client Library

    Do I get the secret and the API key when I  submit the form for building applications on the MySpace Developer Platform?

    Thanks! 


    Filed under:
  • 02-20-2008 12:45 PM In reply to

    Re: PHP Client Library

    Yep. Once you've created an App, under App details (click Edit Details from the MyApps page) you'll see Application Uri and Application Domain. That's your Consumer Key and Consumer Secret, respectively.

  • 02-21-2008 2:46 AM In reply to

    Re: PHP Client Library

    Hi ,

    dos any one know how  to force users to login in order to install app,

    im geting this error ,

    string(136) "401User has not installed the current application."

  • 02-21-2008 1:13 PM In reply to

    • Henry
    • Not Ranked
    • Joined on 02-08-2008
    • Posts 5

    Re: PHP Client Library

    The first three lines of my php... 

    echo 'here1';
      require_once 'Space.php';
      echo 'here2';

    ...it echoes 'here1' and not 'here2'...  anyone else have it not including correctly?

  • 02-21-2008 1:53 PM In reply to

    Re: PHP Client Library

    Does anyone know where I can get the userId from to use it to call the functions (like profile) with?

    Thanks!

    Filed under:
  • 02-21-2008 2:35 PM In reply to

    • Buzz
    • Top 75 Contributor
    • Joined on 02-07-2008
    • Posts 49

    Re: PHP Client Library

     

    Mogambo:

    Does anyone know where I can get the userId from to use it to call the functions (like profile) with?

    Thanks!

     See the introduction docs. There is an explicit example showing how to get user IDs. Start here: http://developer.myspace.com/community/opensocial/helloworld.aspx

     

    Henry:

    The first three lines of my php... 

    echo 'here1';
      require_once 'Space.php';
      echo 'here2';

    ...it echoes 'here1' and not 'here2'...  anyone else have it not including correctly?

    Is that the entire code in your PHP page? Check that Space.php is in the same folder as the PHP page. Also check that oAuth.php is in the same folder... If you still have problems post in more detail...

     

  • 02-21-2008 2:54 PM In reply to

    • Henry
    • Not Ranked
    • Joined on 02-08-2008
    • Posts 5

    Re: PHP Client Library

    Working now, who knows what was wrong.
  • 02-21-2008 3:11 PM In reply to

    • Henry
    • Not Ranked
    • Joined on 02-08-2008
    • Posts 5

    Re: PHP Client Library

    Definitely having some issues with the currentUser thing.  The whole albums bit works fine, but when I add in the currentUser bit, it doesn't echo anything.  Including the albums bit :-)

     Any suggestions?

    Here's my code...

    <?php
    //echo 'here1';
      require_once 'Space.php';
     // echo 'here2';

    $myUserId = 'xxxxxxxxxx';

     $key = 'http://www.myspace.com/xxxxxxxx;
      $secret = 'xxxxxxxxxxxx';
      $s = new Space($key,$secret);
      echo 'here3';
      $hUser = $s->currentUser();
      $hProfile = $s->albums($myUserId);
      echo 'yeah: '.$hProfile["albums"][0]["albumid"].'<br>';
      echo 'holla: '.print_r($hUser).'<br>';
    ?>

  • 02-21-2008 5:33 PM In reply to

    • Marie
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 10

    Re: PHP Client Library

    Sorry, I'm going to be a bit of a dunce here.......thank you so much, btw, for uploading this client library!

     I unzipped both files and put them in the right directory on my server. Then I made a simple index.php to test with. Forgive me if I'm just completely missing the point, but when I upload this index.php to the same directory on my server as the library files, should I see my MySpace app canvas page automatically update as the index.php? (Also, is the Application URI = Key? Because for mine, I put in the url for my server, i.e. http://mygame.dreamhosters.com/myspace)

  • 02-21-2008 5:41 PM In reply to

    • Marie
    • Not Ranked
    • Joined on 02-05-2008
    • Posts 10

    Re: PHP Client Library

    Trevor, I am seeing the same error as you did in the beginning:

     Fatal error: Uncaught exception 'Exception' with message '401 ' in /home/.tux/marielu/fuzzacademy.dreamhosters.com/myspace/Space.php:184 Stack trace: #0 /home/.tux/marielu/fuzzacademy.dreamhosters.com/myspace/Space.php(143): Space->_do_request('users/123456789...', Array) #1 /home/.tux/marielu/fuzzacademy.dreamhosters.com/myspace/Space.php(60): Space->do_request('users/123456789...') #2 /home/.tux/marielu/fuzzacademy.dreamhosters.com/myspace/index.php(7): Space->profile(1234567890) #3 {main} thrown in /home/.tux/marielu/fuzzacademy.dreamhosters.com/myspace/Space.php on line 184

    Did your page just start working after a while?

Page 2 of 9 (134 items) < Previous 1 2 3 4 5 Next > ... Last »