background preloader

Facebook sdk

Facebook Twitter

How-To: Use the Graph API to Upload Photos to a user’s profile - Facebook developers. As part of our continuing series of “how tos,” we thought it’d be interesting to show how you can easily upload photos to a user’s profile.

How-To: Use the Graph API to Upload Photos to a user’s profile - Facebook developers

Photos are a deeply integrated part of the Facebook experience. Publishing photos adds a photo to user’s profile and also generates a newsfeed story about the photo with a link to your app. This is a great way to engage the user’s friends and drive interest for and traffic back to your app. Here’s a sample photo published on a user profile from my ‘Photo upload test app’ app and the newsfeed story published as a result. p> This How-To will walk you through the album and photo objects in the Graph API and the steps you need to take in order to upload a photo to a user’s profile. p> Publishing an Photo In order to publish a photo to a user’s album, you must have the publish_stream permission. . - The photo will be published to an album created for your app. Sample code will be provided for the corresponding two scenarios: Upload Image to Facebook and Tag them Using PHP.

– August 1, 2011 Facebook Our aim is very simple but really worthy for commercial applications. We have seen several applications that create some top friends list as an image and upload them on our wall with several tags. This enables the application to send a notification to tagged members, thereby getting more users. Uploading an image from harddisk is straight forward. But what if I wish to upload an image from some other website url and later tag them. We are going to use facebook php sdk. $facebook ->setFileUploadSupport(true); $args = array ( 'message' => 'by ); copy ( ' , 'tmp/file.jpeg' ); $args [ 'image' ] = '@' . realpath ( 'tmp/file.jpeg' ); Attach image to Facebook event (php sdk, rest or graph api) PHP SDK Demystified – How PHP SDK calls the Old REST API. In the article PHP SDK Demystified – How PHP SDK calls the Graph API, we have looked at the api() method in the PHP SDK.

PHP SDK Demystified – How PHP SDK calls the Old REST API

To recap, the api() method is a pubic method that we used to call Graph API and Old REST API. The api() method is defined as: public function api(/* polymorphic */) { $args = func_get_args(); if (is_array($args[0])) { return $this->_restserver($args[0]); } else { return call_user_func_array(array($this, '_graph'), $args); } } In this article, we will take a closer look at how it calls the Old REST API. If the first parameter (i.e. If you have take a look at the _graph function already, this piece of code should not be that difficult to understand. For Old REST API request, we have to include the application key (you should know that if you have used the Old PHP Client Library before.

Wing's Blog on Facebook Development & Virtualization. In the last article, we have looked at the api() method in the PHP SDK.

Wing's Blog on Facebook Development & Virtualization

To recap, the api() method is a pubic method that we used to call Graph API and Old REST API. The api() method is defined as: public function api(/* polymorphic */) { $args = func_get_args(); if (is_array($args[0])) { return $this->_restserver($args[0]); } else { return call_user_func_array(array($this, '_graph'), $args); } } In this article, we will take a closer look at how it calls the Graph API. If the first parameter (i.e. As we can see, _graph takes 3 parameter: $path This is the path for the Graph object that the Graph API request is working on, e.g.

In many cases, while we issue “GET” graph API requests, we do not specify the $method parameter. Now, let’s recall how you call the api() method for “GET” graph API requests with parameters …. isn’t the parameters are passed as the 2nd parameter in the api() method instead of the 3rd? PHP SDK 3.0 & Graph API base Facebook Connect Tutorial. Facebook recently updated their PHP-SDK to version 3.0 also added new way of authentication.

PHP SDK 3.0 & Graph API base Facebook Connect Tutorial

This is a major change. So this is the updated post of my old popular post. In this version of my code, I avoided javascript authentication, because that is cookie based and php sdk 3.0 has some conflicts with the old system. Facebook will also update the javascript sdk soon, so later you can use the login/logout system of javascript api with php sdk.

But for now you should use fully php base authentication. Using Javascript FB.api to make a full post to a users wall. By David Pratt / Tags: facebook, javascript / 20 Comments / Published: 26-09-10 I just thought I’d make another quick post about the Facebook Graph API seen as there seems to be so little documentation and examples for it.

Using Javascript FB.api to make a full post to a users wall

The below example shows you how to make a full wall post with message, name, description, link, picture and caption to the wall of a Facebook user using JavaScript to call the Facebook FB.api. So, assuming that you have an authenticated session, here’s what you need to do: If you do this right you should get something like this appearing: Spamtastic.