Facebook API Question: Access of Friend Photos?

By Steve Poland   •   April 25, 2008

If anyone has experience with the Facebook API — I’m curious about two calls (maybe more): friends.get and photos.get [and possibly photos.getAlbums].

What I’m trying to do is have a logged-in FB user, in my FB app, be able to browse photos uploaded by friends [not necessarily with themselves in those photos -- but just to see photos by their friends]. Is this possible?

My other question is whether it’s possible to grab comments on photos, for display in my app.

Thanks for any help!




Related posts:

  1. IDEA #72 - Digg for Facebook Photos Not actually Digg, but a Facebook application like Digg, but for photos on Facebook. Facebook apparently has the most photos anywhere on the web — there should be a button under each allowing users viewing...
  2. IDEA #73 - Friends Categorized as API to other Facebook Apps Another Facebook application idea comin’ at ya!… Robert Scoble has vocalized how he doesn’t like the restriction Facebook puts on your number of friends (5,000) and that he wants as many people to be his...
  3. IDEA #71 - User-Gen Opinionated Videos, Photos, or Text (Facebook App) Alright, kinda of similar to this previous idea, but not completely. QUESTIONS TO USERS - we want to extract original video (photo/text) content from our users, thus we want to give them “tasks” in a...
  4. IDEA #67 - Desktop/Mobile IM Client for Facebook Facebook Development API allows desktop apps to be created and has a code library for them. I’m surprised no one has created an Instant Messenging application (like AIM, Yahoo! Messenger, MSN Messenger, etc) that uses...
  5. MySpace vs Facebook - The “Duh” Difference I just realized — I mean, I knew this — but I just realized, MySpace is super-open. You can surf most anyone’s profile and view it — I bet only 1 in 500 profiles are...

Related posts brought to you by Yet Another Related Posts Plugin.

Comments

3 Responses to “Facebook API Question: Access of Friend Photos?”

  1. MyAvatars 0.2 John on April 25th, 2008 11:02 am (perm link)

    I like to use direct fql queries myself, then you can say the exact data you want back. To get the photos you’ll probably want to do two calls, one to get the albums for that user and then do a call to get the photos for that album when they drill down.

    “select aid, cover_pid from album where owner = FACEBOOK_ID”
    gets the albums

    “select pid, link, src from photo where aid = ALBUM_ID”
    gets the photos for an album

    you can probably turn these into a single query if you’d like as well, depending on the api wrapper you’re using there might be an easier way to do this as well.

    As to your second question, as far as I know you can’t get the comments for a photo, you can only get the caption the owner has added.

    Hope that helps!

  2. MyAvatars 0.2 Steve Poland on April 25th, 2008 11:20 am (perm link)

    @John - thx; so with those queries I could ‘get friends’ of a userID, then use that query to grab the photos for each of those friends’ userIDs?

    And I’m so far removed from SQL, but I could specify all those userIDs in that single SQL query, right?

  3. MyAvatars 0.2 John on April 25th, 2008 12:08 pm (perm link)

    ya, that’s right

    “select aid, cover_pid from album where owner in (friend_id_1, friend_id_2,friend_id_2)”

    gets all the albums for those friends. are you going to show all the albums on one big page? I would probably use the facebook friend selector to let the user the friend, it refreshes the page with the albums for that friend which the user can drill into to see the photos in that album.

    What you you building your app in, php, ruby java? There are probably some easier ways to do this depending on the api wrapper you’re using.

Got something to say?





*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word