How to access custom fields Facebook PHP SDK - php

Facebook has in their documentation an example for a custom sign-up form:
<fb:registration
fields="[{'name':'name'}, {'name':'email'},
{'name':'favorite_car','description':'What is your favorite car?',
'type':'text'}]" redirect-uri="URL_TO_LOAD_AFTER_REGISTRATION">
</fb:registration>
I want to create something like this but instead of favorite car my custom field is the address and I want fb-only registrations:
<fb:registration
fields="[{'name':'name'}, {'name':'email'},
{'name':'address','description':'Address',
'type':'text'},{'name':'zipcode','description':'Zipcode',
'type':'text'}]" redirect-uri="http://example.com/register-exec.php"\
fb_only='true' fb_register='true'>
</fb:registration>
After the user registers, does Facebook keep in their database the custom field address and zipcode?
I can run
$facebook->api('\me')
to get user info but can I do something like
$facebook->api('\me\zipcode')
I am making the website facebook-only so I want facebook to keep track of these fields (I don't want to make my own database for this). Also, how can I know if someone has registered to the website when they access a page of the site?
Thanks

Facebook doesn't keep any record of the values provided by the user to any custom fields the developer requests
Your own app needs to process and store those in your own database - they won't be retrievable via the API as they're only passed during validation and submission of the registration plugin

Related

Downloading a LinkedIn Users CV using the LinkedIn REST Profile API

I am wondering if it is possible to make a call to the LinkedIn API using PHP that will allow me to GET the users uploaded CV.
Currently I'm working on some basic API calls that have enabled me to gather information relating to the users contact details, personal details, experience and all of the other fields in their profile. I just cannot seem to find anything within the Developers Docs that talk about retrieving the likes of a CV if it has been uploaded to their account.
https://developer.linkedin.com/documents/profile-fields
I'm wondering if any one has any experience doing something similar? Or if it is even feasible! Of course one possible solution would be to utilize the information I can retrieve from LinkedIn to construct a CV but Ideally I'd prefer to retrieve the document.
My hopes is to create an "Apply Now" button that would pre-populate the application form with user information from LinkedIn. When they click "Apply" It is then emailed to my company HR dept.
An overview of my Basic Attempt at utilizing the API: *having trouble copying my code into the editor here. Will attempt to do so later. For now here is my steps.
Attempt to authenticate my application as follows:
Apply Now
Redirect User to Redirect URL and request an Access Token which I then use to make my API Calls.
I just cant figure out how I might get their CV in whatever format it was uploaded to their LinkedIn Profile.
Users dont upload CV to linkedIn. They fill in their profile. What you should be doing, is, after you get the access token, get the user's profile, and fill in your form with relevant fields.
This can be helpful: https://developer.linkedin.com/documents/profile-fields#fullprofile
You would need r_fullprofile permission.
If you dont need the full profile of the user, see this. https://developer.linkedin.com/documents/profile-fields#profile

Get user details in SocialEngine

I want to get user details in SocialEngine like we make a plugin in WordPress to get user details. How can I get the user details of the logged in user. I don't want to make any packages or widgets. Also I want to place a script into the head of the SocialEngine. How can I achieve this ?
You can easily get user info from 'fields_value' and 'users' table.This plugin will be very useful for you http://www.ipragmatech.com/socialapi-rest-socialengine.html .
The plugin have REST API and very useful to integrate socialengine with other CMS or ERP system.
You can access the current viewer or subject within the page through
$this->viewer()->getIdentity();
The viewer object will give you all the details of the current user viewing the page. You can also call subject with:
Engine_Api::_()->core()->getSubject();
I cover retrieving the user details in a blog post here:
http://garbtech.co.uk/socialengine-getting-the-current-users-id-and-data
I also discuss creating widgets for user profiles here:
http://garbtech.co.uk/socialengine-creating-widgets-for-user-profiles-getting-the-subject-rather-than-the-viewer-information/

Facebook like button and OAuth Access

I am connecting to the Facebook API using HybridAuth on the server side (backend is written in PHP). This is for a SaaS publishing application that is hosted on our servers. I understand the mechanics of OAuth and that once I accquire the appropriate permissions from the user, I can write and read from the Open Graph API, which in theory will allow me to do almost anything.
The problem is that I would like to use some of Facebook's social plugins. In particular, I would like to implement the like button so that it automatically appears for each blog post, article and page.
The problem is that the like button and the various Facebook plugins require an app_id. I would prefer not requiring users to add the developer app to their account and creating an app to get an app_id as it can be a confusing process for non-developers.
Is there anyway we can create or retrieve an app_id from open graph (which we can store and use to generate the like buttons and other facebook widgets)?
With the migrations, I understand that each liked URL will not have it's own page. Once the user clicks a like button on your site, he automatically likes your page. However, let's say I have a page called http://www.mystore.com/products/some-awesome-product and there are other similiar pages, all with a like button. Is it possible that when clicking like, the user automatically likes our Facebook page, but when an item is published in their news feed for the like, the URL links to that specific product? Effectively, is there a way for users to like multiple pages from my site?
Update: It looks like we can generate app_ids programmatically with the create application API in the legacy REST API. However, this does not seem to be an option with the graph API.
Seems like we cannot programatically create an app_id for an account. This is not an issue, as we will just create a small guide to guide our users through creating an app and submitting the app_id to us using a form. Not perfect, but should be easy to implement.
As for URLs, liking something will not automatically like your Facebook page. If href is blank, the current page will be liked. If you set your facebook page in the href parameter, then your facebook page will be liked.

PHP posting on page wall

I have a website where users can post jobs for free. How can I link these posts to a facebook page about this website? I don't want the users to login to fb.
At this moment I post them to twitter and then using selective tweets to post them on my page. But selective tweets is not able to post logo's specific for that job.
I created a fb app. Did not select anything just gave it a name and got an appID and appSecret. I dont now what to select in "Select how your app integrates with Facebook". Becouse it is not a mobile app and it is not a website with fb login.
Kind regards.
you can use share on facebook facility of facebook ,from http://developer.facebook.com.
you can easily add this to your website.
have fun!
You can do this easily via MYSQL and PHP, depending on how your current site is setup. What i would do is store the jobs into a separate table while saving, like this
(table) Facebook
pageid //numerical value
header //job title
message //job description
So that you can use it for the next part.
Create an application via Facebook and give it authentication to users and your Facebook page.
by adding this application to your page you can then call something like :
$facebook->set_user($user, $session_key);
$facebook->api_client->stream_publish($item['header'], $item['message'], $item['pageid']);
Using your keys from facebook.
Then you can run a Cron that updates every x minutes, and after it has posted it, in an array, you can clear the table for the next row of jobs.
Let me know where you are on this and ill try to help as much as possible.

wordpress frontend posts to automatically post on user's facebook timeline

Can someone please give me some hand on how should I setup this flow on my website:
User is already connected to the site with facebook connect with these permissions: email, read_friendlists, publish_stream, publish_actions. And that all works fine.
User submits an article from frontend in wordpress successfully.
What I want to do is when add_post() action is triggered (using custom theme) and successfully submits article in wp, I would also like to post the same article to the user's fb timeline.
Believe me I've read all the darn documentation in FB dev but no straightforward example on how I could do that.
They mention using curl to graph api , but how to use it? With php or javascript? Maybe you will have any working example cod so I could have a look?

Categories