I used the advice in
https://support.oneall.com/forums/discussion/comment/3513 to link fields from Facebook to my user profile data, works great, thank you.
Can anyone provide a method for bringing in the twitter homepage url to my field called field_twitter_home_url ?
A list of all available fields would be really helpful for us to adapt social data to our custom drupal profile fields.
Answers
A good source for such information is the demo page oneall.com/services/social-login/#social-login-demo, which would show a typical response.
In our Drupal 7 plugin, you can see the following shorthands:
$data = $social_data['response']['result']['data']; $identity = $data['user']['identity'];
which should give you a start in addressing any field you see in the demo's response.
So, for your question, that should be $identity["profileUrl"], as in:
$profileurl = empty($identity['profileUrl']) ? '' : $identity['profileUrl']; $form['field_twitter_home_url'][LANGUAGE_NONE][0]['value']['#default_value'] = $profileurl;
Hope this helps.
I am guessing $identity["profileUrl"] would return a value on several login methods.
Yes, this profileUrl is present on several social networks.
Maybe that custom field could be more generic, maybe split in home page, and type (twitter, ...). Just a thought.
Something like maybe:
if ($identity['provider'] === 'twitter') { $profileurl = empty($identity['profileUrl']) ? '' : $identity['profileUrl']; $form['field_twitter_home_url'][LANGUAGE_NONE][0]['value']['#default_value'] = $profileurl; }
Hope this helps.
https://www.drupal.org/project/link
Not sure how related this is, but we now have a Rules integration, which is what you suggested apparently (thanks for that!).
It is basic, as it exposes an event, with the social profile (text), that you can use to write rules. The event is triggered when a user registers with Oneall automatically (not via the register form).
It is ready, but not yet distributed (in a few days, now on github.com), but we can send over the module if you want.
Anyway, could this help fill in a link field you mention?
Regards.