Welcome Developers!

in

Welcome!

in

Total Number of Friends

Last post 12-06-2012 2:44 AM by Vasim. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 09-02-2010 11:20 AM

    Total Number of Friends

    Is there a way to get the viewers total number of friends using API in an iframe? 


  • 09-02-2010 1:45 PM In reply to

    Re: Total Number of Friends

    you can make a call like this:

    http://opensocial.myspace.com/roa/09/people/myspace.com.person.xxxxxxxx/@friends?count=100

     

    where the userID goes into the x placeholder spot.

    thanks,

    Joel

  • 09-03-2010 9:27 AM In reply to

    Re: Total Number of Friends

    That only pulls up to 100 for me.  If I have over 100 friends it comes back with 100 not the total.

    If I have 590 friends I see only 100, I want to be able to get the total 590.

     

  • 09-07-2010 1:35 PM In reply to

    Re: Total Number of Friends

    You can do something like this to page the results (you don't need to use all the params as in this specific example, however):

    http://opensocial.myspace.com/1.0/people/@me/@friends?ts=1282242493190&filterBy=hasapp&filterOp=equals&filterValue=false&startIndex=1&count=20

     

     

    thanks,

    Joel

  • 09-08-2010 8:12 AM In reply to

    Re: Total Number of Friends

    I am trying to get a total so I can calculate the number of total pages I need to display all the users friends like the page_1 page_2 page_3.... links at the top.  example 586 /100 I would place pages 1-6 at the top for people to select the one they want.

    Is there a way just to get the total friends as one varilablethat I could then use to calculate the total of pages of friends the viewer has.

    Is there also any way to sort the people, by online or by last login?

     

  • 09-08-2010 12:30 PM In reply to

    Re: Total Number of Friends

     When you make the call I mentioned above, what api response do you get? It should indicate paging if the total is beyond the number requested in the call.

     

    thanks,

    Joel

  • 09-08-2010 11:43 PM In reply to

    Re: Total Number of Friends

    Isn't one of the fields returned (at the end) called

    'totalresults'

    which holds the total number of friends regardless of page size?

    Eddie

     

  • 09-15-2010 11:59 AM In reply to

    Re: Total Number of Friends

     It should, indeed.

     

    -Joel

  • 09-20-2010 9:41 AM In reply to

    Re: Total Number of Friends

    Right you are, there was the total total at the end.  I hadn't noticed it thanks

  • 09-20-2010 12:05 PM In reply to

    Re: Total Number of Friends

     Cool.

     

    thanks,

    Joel

  • 12-06-2012 2:44 AM In reply to

    • Vasim
    • Not Ranked
    • Joined on 05-10-2012
    • Posts 1

    Re: Total Number of Friends

    // Contact : iamvasim@gmail.com (http://www.kliptu.com)

    $myspace_url = 'http://www.myspace.com/vasimpadhiyar';

    $username = @strtolower(substr(strrchr($myspace_url, "/"), 1));

    $url = 'http://myspace.com/'.$username;

    $myspace_html = file_get_contents($url);

    preg_match_all('/<span class=\"count\">(.*)has (.*) friends.<\/span>/i', $myspace_html, $myspace);

    echo $friend_count = $myspace[2][0];

     

Page 1 of 1 (11 items)