Like Page Photo From Website PHP SDK 5.0 - php

Was wondering if its possible to like a page post photo on Facebook from a website using the PHP SDK version 5?
I have managed to authenticate a user using the SDK but having troubles finding out if this is possible.
Any examples would be appreciated (if its possible).
Thanks.

No, it is not. Not in the name of the app user.
Facebook has recently removed the possibility to like Facebook objects such as posts, photos and comments via API in the name of a user.
https://developers.facebook.com/docs/apps/changelog#nov-17th--2016

Related

How to send a friend request through the PHP Facebook API

I'm working on a website where I'd like to allow a user to send a Facebook friend request to another through the website. I have the Facebook account information for both. Is this possible? I know it was in the old version of the GRAPH API and also using FBML, both of which are outdated now.
Cheers!
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friendrequests#publish
You can't publish using this edge. The Friends Dialog should be used if you want to integrate the ability to add someone as a friend in your app.
The Friend Dialog was removed with v2.0, so there is no way anymore.

How to retrieve newsfeeds posted by FB apps using FB graph api?

I've been sarching for hours on FB graph api docs and google but couldn't find a solution. Let me explain my question. Using the FB graph API, we are able to retrieve user's newsfeeds, but how do we retrieve user's newsfeeds that are posted by FB apps, such as game scores/achievements? I know that it's possible to retrieve user's newsfeeds created by a specific app by adding filter=app_[app_id], but is there a way to filter newsfeeds that are created by any apps?
Currently what I do is that, if a newsfeed contains a link that links to app.facebook.com, I assume it's posted by an FB app. I'm not sure if this assumption is safe and is there a better way to achieve my goal?
P.S. I use php SDK so a php solution is highly appreciated. Solutions using other SDK are also appreciated. I'll try to make a conversion by myself.
Thanks in advance,
Kaze
Currently what I do is that, if a newsfeed contains a link that links to app.facebook.com, I assume it's posted by an FB app.
Posts in /me/feed that have been made by/using an app should have a property "application" set, which contains the app name, namespace and id – so by just looking for that you should be able to determine if it was posted by an app or manually.

Upload photo to facebook using Rest API

Can you please have a look to this URL
http://developers.facebook.com/docs/reference/rest/photos.upload/
I need to have a working example, how can I use this api to upload a photo to my facebook profile.
Actually I have a php site from where I want to allow users to upload photo to their facebook profile.
Thank you
The link you posted refers to an outdated approach to FB API. It's better to use the Graph API in conjunction with the latest PHP SDK.
http://developers.facebook.com/docs/reference/api/
https://github.com/facebook/php-sdk
here's a reference to the photo object methods
http://developers.facebook.com/docs/reference/api/photo/
Here's a fairly recent example from the facebook developers blog:
http://developers.facebook.com/blog/post/498/

How to Post to My Facebook Fan Page using PHP and Graph API?

i like to post to my FB Fan Page, Some Content using cron job in PHP,How can i do that?
Can you gave me example?
After becoming familiar with the Graph API check out Facebook's documentation for Pages
http://developers.facebook.com/docs/reference/api/page/
Here is the main page for Facebook's Graph API documentation
http://developers.facebook.com/docs/api
For PHP Development, check out this SDK, It will make your life much easier for interacting with Facebook using PHP
https://github.com/facebook/php-sdk/
Here is a link for how to configure your Facebook APP to be able to post on a Facebook Page
http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/
(I did not follow this exact tutorial but slaved to figure it out myself, so let me know how it works for you)
note As I mentioned in a below comment make special note of the permanent session key.

Accessing a pages events using facebook graph api

Just started working with the Facebook graph api and have hit abit of a wall. I want to access facebook pages by using the api /events/ however i have discovered that this requires an access token, IE a login. (at least thats how i think works)
Basically my site lists bands and events, so id like the user (band) to specify a connection to their facebook page if they have one (pageId) so i can dynamically pull the events they have posted to their facebook page.
Is this even at all possible? at the moment i am able to pull in the pages feed like /feed/ but running /events/ throws an excpetion saying it requires an access token.
Im using PHP with a fresh install of codeigniter 2.0 its also worth mentioning im using elliot haughins facebook library facebook library though this isnt essential to my project
You can register an app with facebook and it can have it's own token that you can use to access the event for pages. You can find out how to get an app token here. http://developers.facebook.com/docs/authentication/
Hope that helps.

Categories