how to read facebook profile timeline feed with Graph API? - php

I am using Facebook PHP-SDK v5 with Facebook Graph API v2.10 and by other code i am able to get data from facebook page easily, but what i need is to fetch data of user profile wall ,
from facebook Graph Explorer i am able to read those data by generating token. but not by code.
it will throwing error
URL blocked: This redirect failed because the redirect URI is not white-listed in the app's client OAuth settings. Make sure that the client and web OAuth logins are on and add all your app domains as valid OAuth redirect URIs.
and i have used localhost url in the app oAuth setting as well,
I wanted to read someones wall post feed after authorize him by my applications, i dont want to read my own profile like api('/me/feed'
does anyone help me in this case.

Related

Upload videos to youtube using youtube api by any remote user

I'm trying to upload a video on youtube using google-api-php-client but after all the process I have done. I had to authorize following a link (authorize access) and on localhost its generating the error 400. Error: redirect_uri_mismatch
and says,
The redirect URI in the request, http://localhost/youtubeVideoUpload/upload.php, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs,;
I want to ask that
Firstly how can I solve this issue;
Secondly Is there any way that I can authorize any remote user to upload video on my youtube channel using php
Authorization Required
You need to authorize access before proceeding.

Getting different results between PHP SDK and Graph API explorer

I'm facing the following problem:
When I'm trying to read all the comments from a posto of me on facebook via the Facebook php sdk ( Graph API) i can't get all of them, while when I am using the Facebook Graph API explorer, they are all appearing.
My App's permissions are the same with Graph API explorer's permissions.
Any ideas?
Thanks..
Are you authenticating as a user in your PHP app? In the Graph API explorer, by default you have a user access token. If your app is just using the app id & secret, you will not see any post marked with a privacy less than "everyone."
You can test this in the explorer by getting an app access_token and pasting this into the access token box in the graph explorer.
in the Graph API Explorer, try to change Application (by default is Graph API Explorer) with your App.
if still can't get all of the comments, just delete you App, and recreate.

Posting to facebook timeline from an external site

Scenario: While logged into facebook, I click on a share link on my site. It pops up the dialog to post to my timeline.
Question: Is it necessary to create an app to do this? Or does facebook offer an app that will request permissions to do this for you?
My current plan is to use the facebook graph API with the php sdk to ask for the proper permissions, build the timeline POST request with an access_token. I just wasn't sure if there was an easier way to do this. Thanks!
Graph API is all that you need. Your server needs to support OAuth 2.0 authentication.
Add the URL of the script that handles this in the configuration page of your FB app.
Request for an access_token with offline_access permission. (offline_access allows you to post to user's timeline even when he is not logged on). With the access_token, do a HTTP/POST with params message and access_token to https://graph.facebook.com/me/feed as shown here.
NOTE: FB is deprecating offline_access from May 1, 2012. Check this.

Facebook, twitter, youtube livestream on website

I'm trying to create a live stream of comments and disscussions from a twitter, facebook, and youtube page for a social site. Has anyone ever done this before, if so any advice or websites/articles to check out. I'm thinking PHP curl?
You'll probably need permissions from user (application permission request) and then request
https://graph.facebook.com/me/feed?access_token=...
where access_token is token returned from facebook after aproving permissions

PHP Facebook API

Aarg, can't find a good answer to this question:
How can I auto-login on Facebook (knowing the username/password from a user) and then post a message on the wall? I already downloaded facebook.php, base_facebook.php and other files, but I don't how I can get this working...
You will need to create a facebook app. This will give you the appId and secret that are required to do most things with the graph api.
You don't even need the username and password of the user, they can authorise your app to post to their wall.
You can find all the info https://developers.facebook.com/docs/
You can use the facebook graph api and oauth to post on the facebook wall of a user.
Facebook's API does not support authentication via a user's email and password. You don't need facebook.php, or base_facebook.php. What you need is PHP and cURL to mimic browser HTTP requests and login to Facebook manually.
Try logging in to http://m.facebook.com and use Firefox's Firebug Addon or Chrome's Developer Tools to monitor browser requests.

Categories