views:

772

answers:

3

Hello stackers,

I'm trying to convert friend pages into fan pages (most businesses have created friend pages by mistake) and am trying to email everyone on a friend list about the move.

I've tried

  1. FQL "SELECT email FROM user WHERE uid=xxxx"
  2. Creating groups (not good for 5000 friend pages)
  3. Restfb: Connection myFriends = facebookClient.fetchConnection("me/friends", User.class) etc;

The FQL and RestFB methods are both returning nada, group email method is just plain messy.

Is this a security feature or can this data ever by returned for my purpose?

Cheers

A: 

Facebook does not provide user, unless the user authorizes your application to access it. It's on account of security and user privacy, imagine how terrible it would be if everybody could have at her disposal all FB user's email addresses.

falomir
But as they are "accepted" friends from both sides, I can see their email addresses through the site. Just seems strange that I can do it manually but not through the api.
Ilikerashers
take a look at this http://wiki.developers.facebook.com/index.php/Proxied_Email
falomir
thanks but I think that refers to applications. I'm just using an access token generated by my profile. I can return a list of friends and their unique Ids, problem is everything else is blank.Example: User[about=null birthday=null education=[] email=null firstName=null id=12345678 interestedIn=[] lastName=null link=null metadata=null name=Tom Jones picture=null relationshipStatus=null religion=null timezone=null type=null updatedTime=null verified=null website=null work=[]]
Ilikerashers
Ok, what I have done is get the unique IDs, and then use them within the FQL to fetch the info accordingly, for example, assuming that you have in a $IDS variable all the unique IDs glued together separated by commas 'SELECT uid, first_name, last_name, hometown_location, pic_square, activities, interests, work_history FROM user WHERE uid IN (' . $IDS . ') ORDER BY last_name';
falomir
Still the sameString query = "SELECT uid, first_name, last_name, hometown_location, pic_square, activities, interests, work_history, email FROM user WHERE uid=" + currentUser.getId(); List<User> users = facebookClient.executeQuery(query, User.class);Thats what I'm running but getting a load of nulls. Will update if anything pops up.Thanks
Ilikerashers
A: 

I'm having this problem as well, have tried FQL, Facebook Graph etc, using OAuth, Session Key and Session Secrets but the only thing I get back is first name and last name. On occasion I do end up getting a proxied email which is useless since when you send to the proxied email, you get the message from "Test Console". Not sure if I am missing something or is Facebook just really tightening up data period? I've even relaxed all privacy settings.

Ooolalashop.com
A: 
Connection<User> myFriends = facebookClient.fetchConnection("me/friends", User.class ,Parameter.with("fields", "id, name, picture, email"));

You can specify any of the properties listed under http://developers.facebook.com/docs/reference/api/user

The only thing is that FB does not seam to return the friends email.. I'm using restFb 1.5.3

Paul Pinguin
Yeah it looks like email just isn't available through the API. This is a bit strange since a few companies are scraping the site to get the data yet going about it the legal way doesn't work.
Ilikerashers