

Show HN: FbFriends, a JS dialog for picking FB friends - icambron
http://icambron.github.com/fbfriends/

======
xauronx
Very nice! I might try to use it later today for a project I've had cooking
for a while. What is the structure of the friends object after the dialog
closes? What information do we get about them?

~~~
icambron
I need to document that better. Here's what's passed to the callback:

    
    
      [
        {
          id: anFbId,
          name: "Some guy",
          picture: "a url"
        },
    
        //other friends in the multi-selection case
      ]
    

If there's other kinds of information you'd want, I'd love some feedback on
that.

~~~
xauronx
Does facebook expose their email address to you? I would like to use this to
allow people to invite their friends to sign up for my service but I'm not
sure how I would do that. I guess I could use facebook APIs to send them a
message in lieu of email.

~~~
icambron
When you set up an FB application, it lets you specify what information you
want the user to make available to you. When the user approves the app, the
dialog specifies what info the app is asking for. I assume that "friends'
email" is one of those options. Then FbFriends would be able to ask for that
info. So to support this, I'd need to:

1\. expose to you as the developer the ability to specify the list of
attributes to request from FB (hardcoded right now).

2\. just pass the object I get from FB straight to the callback instead of
mucking with the object (makes some things, like the picture, a bit more
complicated).

3\. document how to set up the Facebook application to get the right
permissions from the end-users.

That all seems reasonable, and I'll take a crack at it later today when I'm
done with my 9-5.

~~~
xauronx
That would be pretty awesome! Let me know how it goes or if I can give any
input at all.

~~~
icambron
So I'm writing the feature that lets you specify what fields you want and will
pass the resulting FB object directly back to you (edit: now done and in the
trunk).

However, you can't get the email addresses of friends. From
[https://developers.facebook.com/docs/reference/login/email-p...](https://developers.facebook.com/docs/reference/login/email-
permissions/): "Note: There is no way for apps to obtain email addresses for a
user's friends."

~~~
xauronx
Oh, well, that kind of makes sense but it's a bummer anyhow. I guess it would
be pretty easy to send them an invite on facebook via wall post or message
though.

------
bavidar
nice tool! Tried searching for friends by first name. Some dont work with just
first name. Might need to do finagling with the regex.

~~~
icambron
It doesn't use a regex on the full name; FB provides separate fields and
FbFriends searches those with a simple ORed string compare. So I'm surprised
it's not working for you. I wonder if whatever FB uses to split the name up
(i.e. _their_ regex) isn't doing the right thing for your friends.

Or it could be a bug. I'll look into it.

------
hayksaakian
What are some use cases?

~~~
icambron
The use case I built if for was that I wanted wedding guests responding to an
invite to be able to identify their +1 as one of their FB friends.

But I suppose the most common use case would be inviting a list of friends to
an application. I've seen a number of apps that have that, and as far as I
know, they all roll their own dialog for doing that.

