Modified code to use Facebook php sdk.