how to retrieve gender from google sign-in SDK? - googlesigninaccount

I followed that sample:
https://developers.google.com/identity/sign-in/web/people
and could successfully login with google.
I can retrieve these data:
profile.getId(),
profile.getName(),
profile.getGivenName(),
profile.getEmail(),
profile.getImageUrl()
But.. how can I retrieve the gender of the user ?

You can retrieve the gender using Google.Apis.Oauth2.v2.Data.Userinfoplus.Gender
More information click here

Related

Line Bot; how to get user LINE ID?

i am trying to create line chatbot with several functions in it. One of the function need to know the user LINE ID (for example: ryan123) not user id (U858382312321123......). I am using google app script to create the line chatbot
is it possible to get user LINE ID using API? or is there any way to get this through line bot?
/profile/{userId} is the only* way you can get displayName
*though there endpoints to get the profile with userId by further specifying the groupId or roomId
In case your Messaging API bot is a verified or premium account, you can use a list of userId of followers at anytime with followers/ids
Otherwise, you need to store them upon follow, messsage, etc. events

How to get user information from hippo via HST

I'm evaluating the hippo cms,
after add hst-security as a dependence ,so public site need login, but how can I fetch the login user's detail information like email and something else.
I used HstRequest.getUserPrincipal ,but only get the username.
and tried to write a query "SELECT_USER_QUERY = "SELECT * FROM hipposys:user"
but only get a user 'liveuser', after login with admin.
so , Anyone can help me ,how can I get the detail info?
You can do this:
final User user = JcrSessionUtils.getHippoSession(request.getRequestContext().getSession()).getUser();
user.getEmail();
user.getLastLogin()

Facebook API not returning work and position fields in people query

Querying user data on Facebook Graph via the Javascript API will not return all fields.
For example, the following query:
/search?q=David Blades&type=user&fields=location,work,id,name,picture,link
Returns everything except work and location.
Does anybody know the reason why?
Because these fields are not publicly available, please refer to the User object:
Name Permission
id No access_token required
name No access_token required
...
location user_location or friends_location

Retrieving Interest/Page information out of facebook

Im wondering if there is anyway to interogate facebook data on user interests. i.e. Retrieve the following data sets:
What are the most like interests/Pages on facebook?
Retreive the current users facebook interest and also their friends interests?
Really want to know if we can get facebook global interest/like data and than also if the user connects their facebook account to the site than we can also retrieve their interest data.
Thanks in advance
So you want to implement something like http://www.socialbakers.com/ ?
To get 1) you'd have to periodically poll the API for the public fan count of a known set of page IDs to see the current fan counts ( i think this is what socialbakers do)
To get 2, get the user_likes and friend_likes extended permissions from your users and access the /likes connection of the users whose likes you want to read
Yes you can retrieve user interests from facebook. You just need to include the user_interests permission required in your jsp page.
https://developers.facebook.com/tools/explorer/
If you are using spring social you can generate your own url for /me/interests:
URIBuilder uriBuilder1 = URIBuilder.fromUri(facebook.GRAPH_API_URL + "me" +"/interests");
String s = facebook.restOperations().getForObject(uriBuilder1.build(), String.class);

facebook connect - get profile photo in high/original resolution

is there any way to get the profile photo of a users in a higher resolution than "large" which is 200x0...
https://graph.facebook.com/19292868552/picture?type=large
Thanks in advance!
I'have the same problem at the moment. My solution is to use the coverId of the profile album cover.
You can use GraphApi to get all Albums of the User
https://graph.facebook.com/%profileId%/albums
and use the coverId of the album with type 'profile' to get the profile photo
https://graph.facebook.com/%coverId%
Otherwise you can build a fql query like this
SELECT src_big FROM photo WHERE pid IN (SELECT cover_pid FROM album WHERE owner = %profileId% AND type = 'profile')
i found this in the facebook developer docs by writing the query for the answer
http://developers.facebook.com/docs/reference/fql/photo/
I hope this help you