Facebook API How to add tags to post API using PHP?
First Follow all the 5 Steps from my Previous post http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/ then in last program include below code to add tags to your post.
Publishing a Tags to a Post
$message = 'From My App: publish steven tags on facebook';
$tag_links = array( array('text' => 'Tags here',
'href' => 'http://blog.theunical.com'));
if( $facebook->api_client->stream_publish($message, null, $tag_links))
echo "Added on FB Wall";
} catch(Exception $e) {
echo $e . "<br />";
}
Exiting isn’t it.
–Steven
What Are The Top Brands On Facebook?
Filed under: FaceBook Integration, Facebook, Featured, Technology News
AllFacebook boasts a nice feature where you can see what the top performing Facebook Pages are – meaning which Pages have gathered the largest following to date. The problem is that there’s apparently a significant lag, and that the data presented is therefor inaccurate (for example, it undercounts the number of fans of the popular Texas Hold’em Poker page by nearly 1.5 million).
Enter Fan Page List, which is entirely dedicated to ranking the most popular Pages on Facebook as well as rankings for various categories, such as Actors, Politicians, Movies, Games, TV Shows, News, Athletes and more, in real time.
One of the categories that is the most interesting is the list of top brands on Facebook.
Let’s have a look, shall we?
The most popular brand on Facebook is … Facebook, with just over 9 million fans. The only other Internet / technology brands in the top 25 are YouTube (#4 with 5,082,029 fans) and Google (#21 with 1,269,926 fans). Food and clothings brands seem to do much better.
In case you’re wondering why Apple is nowhere to be found in the top brands ranking: the Cupertino company doesn’t even have a proper Facebook Page to begin with (it looks like facebook.com/apple was taken by someone else). Microsoft does, but only comes in at #99 with 117,444 fans. But hey, at least they still made the top 100 list, right?
Here are the top 10 brands on Facebook (for the full list, go here):
1) Facebook (9,024,542 Fans)
2) Starbucks (7,217,370 Fans)
3) Coca-Cola (5,529,595 Fans)
4) YouTube (5,082,221 Fans)
5) Disney (3,475,487 Fans)
6) Victoria’s Secret (3,436,811 Fans)
7) Converse (2,743,227 Fans)
McDonald’s (2,260,698 Fans)
9) H&M (2,045,964 Fans)
10) MTV (1,871,241 Fans)
Post via Tech crunch
New Facebook Site Touch: http://touch.facebook.com/#home.php
Filed under: FaceBook Integration, Facebook, Featured, Technology News
Check the new site ace book Touch, http://touch.facebook.com/#home.php . It seems like they are doing some location API.
Sooner iTunes To Integrate Facebook Connect
Filed under: FaceBook Integration, Facebook, Featured, Technology News
We’re hearing that iTunes will be implementing Facebook Connect support in the near future, allowing users to share some of their recent purchases with their friends on Facebook. We’re still gathering more details, but it sounds like this could happen quite soon.
It certainly adds up. Over the last few weeks, iTunes has been building out its Facebook Page at Facebook.com/iTunes, which now includes polls, featured items, and is being promoted in iTunes itself. And Lala, which was acquired by Apple in December, has extensive experience working with Facebook Connect (they also power Facebook’s song gifting feature).
To be clear, you can already share songs on iTunes using both Facebook and Twitter (the feature was introduced last September). It sounds like this integration would make this easier, and there’s obviously the possibly for Apple to leverage Facebook’s social graph in much more interesting ways in the future.
Apple has previously worked to add Facebook support to other apps — iPhoto includes an integrated Facebook photo uploader.
Facebook acquires Divvyshot To Make its Photos Better
Facebook just bought up Divvyshot, a Y Combinator-backed startup that launched last March. Divvyshot was in the midst of raising an angel round when Facebook swept in with a better offer. The amount of the acquisition is not being disclosed, but it was likely small. Buying Divvyshot is a talent acquisition for Facebook. Founder Sam Odio and the two other Divvyshot team members will be joining Facebook and working on Facebook Photos, which is the largest photo-sharing service in the world.
Divvyshot is a group-sharing photo site which takes a slightly different approach than other photo sites. Most photo sites think of the photos as tied to the camera. Odio designed Divvyshot so that photos are tied to places, people, and events. So instead of 50 different shots of the same event, 50 people can all share the same photo. Facebook Photos works on a similar principle, if in a more ad-hoc fashion. People upload photos and tag the people in them. When you get tagged in someone else’s photo, it gets shared with you. If the Divvyshot acquisition is any indication, there will be many more ways to automatically share photos through Facebook in the future.
Divvyshot itself will be shut down. The site has 40,000 active, but loyal, users. Instead, Odio and his team will take what they learned at Divvyshot and apply it to the much larger canvas of Facebook Photos. Existing Divvyshot users will be able to continue to use the site, but no new accounts will be able to be created, and its iPhone app will be taken off of iTunes.
Currently, Divvyshot albums can be edited by multiple users, and can be set as private (only allowing designated friends to upload photos) or public, which lets anyone upload their photos to the album. All photos are presented at a fairly high resolution on the site, and are also available at their original quality for download (you can also download entire albums at a time as .zip files). Divvyshot has deep integration with photo services including Flickr, Facebook and Twitter so you can upload all your photos from these sites. The site recently launched an iPhone app that lets users upload and monitor event activity in real-time and contains much of the core functionality as the web application.
http://divvyshot.com/facebook/
Facebook obtain registered trademarks in the United States for “Developer Garage” Trademark
Filed under: FaceBook Integration, Facebook, Featured, Technology News
Facebook has lately been ramping up efforts to obtain registered trademarks in the United States and other countries and regions for a number of products and services it offers or intends to offer in the future.

Fresh off the heels of applying for a trademark for Credits, its virtual payment system, the company is now attempting to gain exclusive rights to the use of the term “Facebook Developer Garage”.
In case you’re not aware, Facebook Developer Garage events are developer get-togethers hosted all over the world, which are being described as “a place to explore, get gritty, tinker, experiment, and test out ideas for Facebook Platform”.
Interestingly, Facebook filed for a trademark in three separate classes, only one of them including “sponsoring and organizing online and live exhibitions and events in the field of software development”. I’m not sure if that means Facebook intends to use the term ‘Developer Garage’ for more endeavors in the future or if they’re simply covering all their bases, but here are the descriptions of the two other classes the company applied a trademark for:
International Class 009: Computer software development tools; computer software for use as an application programming interface (API); application programming interface (API) for computer software which facilitates online services for social networking, building social networking applications and for allowing data retrieval, upload, download, access and management; computer software to enable uploading, downloading, accessing, posting, displaying, tagging, blogging, streaming, linking, sharing or otherwise providing electronic media or information via computer and communication networks.
International Class 042: Computer services, namely, creating virtual communities for registered users to organize groups and events, participate in discussions, and engage in social, business and community networking; computer services, namely, hosting electronic facilities for others for organizing and conducting meetings, events and interactive discussions via communication networks; application service provider (ASP) featuring software to enable or facilitate the uploading, downloading, streaming, posting, displaying, blogging, linking, sharing or otherwise providing electronic media or information over communication networks; providing an online network service that enables users to transfer personal identity data to and share personal identify data with and among multiple websites; providing information from searchable indexes and databases of information, including text, electronic documents, databases, graphics and audio visual information, on computer and communication networks; providing temporary use of non-downloadable software applications for social networking, creating a virtual community, and transmission of audio, video, photographic images, text, graphics and data; computer services in the nature of customized web pages featuring user-defined or specified information, personal profiles, audio, video, photographic images, text, graphics and data.
Trademark applications for ‘Facebook Developer Garage’ were filed in the U.S. on the 24th of March, and in Europe on the 29th of March.
Facebook Likely To Release A “Like” Button
Filed under: FaceBook Integration, Facebook, Featured, Technology News
There will be lots of news leaking about Facebook’s product announcements at their upcoming F8 Developer Conference in April. That’s because they’re already starting to test out a lot of the new stuff with third party developers, and once two people know a secret, it isn’t really a secret any more.

One of the new features we’ve been hearing about is the extension of Facebook Connect and the Facebook API to allow publishers to add a “Like” button to any piece of content on their site.
Sound trivial? It isn’t. This is likely part of Facebook’s Open Graph API project that will incentivize third party sites to interact deeply with Facebook by sharing content and associated metadata.
Today you can “share” content with Facebook via a simple button (you can see our implementation at the top of this post). The new Like feature goes way beyond the Share button, we’ve heard.
Good for publishers? Yes. But it’s also very, very good for Facebook as hundreds of thousands of websites will rush to format their content to exactly Facebook’s preference and send over all their data without a second thought.
One way to think of this, says a source with knowledge of the product, is this. Google spends billions of dollars indexing the web for their search engine. Facebook will get the web to index itself, exclusively for Facebook.
Yes, it’s a big idea. Or, as MG put it, the entire Internet will be turned into a tributary system for Facebook. And it all flows from a simple Like gesture, and a few other features we’ll be writing about shortly.
Publish on Facebook Fan Page as fan user Using PHP
First Follow all the steps to give permissions to publish on Facebook. http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/
Add FaceBook application to your fan page
Just Go to http://www.facebook.com/apps/application.php?id=ID_OF_YOUR_APP.
Find link ‘Add to my Page’ on the left, click on it. Find your page on the list and click on ‘Add to page’ next to this page.
Set Your Application type as WEB
Go to http://www.facebook.com/developers/editapp.php?app_id=ID_OF_YOUR_APP.
Choose ‘Web’ next to ‘Application type’ and click on ‘Save Changes’ button.
Add permissions to your app
Prepare special link:
replace YOUR_API_KEY for an API KEY of your application and ID_OF_YOUR_PAGE for an id of your page
Run this URL in your web browser. Click on ‘Allow’. This will set the permissions to your application to publish on page.
You should see a message: ‘Success’ message.
Check Permissions
Go to http://developers.facebook.com/tools.php?app_id=ID_OF_YOUR_PAGE and check your permissions.
Choose your application, change ‘Response Format’ to JSON, choose method ‘users.hasAppPermission’, fill publish_stream in ext_perm and id of your page in uid.
You should see result: 1.
That means that everything is ok. If the result is 0. then something went wrong. Then check all the above steps again.
Code To Publish on Fan Page as Fan User Using PHP
Then to publish on fan page as a Fan page user and not the facebook user just follow below code.
For this you need to get Fan page ID:
Example : http://www.facebook.com/pages/Fan-Page/xxxxxxx
where xxxxxxx is the fan page id.
In Steam publish method just replace the $page_id with your above fan page id.
stream_publish($message, $attachment,$action_links, null,$page_id).
<?php
// FB_APIKEY is your facebook application api key
// FB_SECRET is your application secrete key
define('FB_APIKEY', 'YOUR_APIKEY');
define('FB_SECRET', 'YOUR_SECRET');
define('FB_SESSION', 'YOUR_SESSION_key');
require_once('facebook-platform/php/facebook.php');
try {
$facebook = new Facebook(FB_APIKEY, FB_SECRET);
$facebook->api_client->session_key = FB_SESSION;
$fetch = array('friends' =>
array('pattern' => '.*',
'query' => "select uid2 from friend where uid1={$user}"));
echo $facebook->api_client->admin_setAppProperties(array('preload_fql' => json_encode($fetch)));
$message = 'From My App: publish steven on facebook Fan Page as Fan User';
$page_id ="xxxxxxxxxxx";
if( $facebook->api_client->stream_publish($message, $attachment,$action_links, null,$page_id))
echo "Added on FB Wall on Fan Page";
} catch(Exception $e) {
echo $e . "<br />";
}
?>
Below is the screen where you can see the message published are fan user.

– Steven
Follow Us
Get Satisfaction On Facebook To Socialize Customer Support
Filed under: FaceBook Integration, Facebook, Featured, Technology News
Build a viral and loyal community by transforming your fan pages into a service center and advocacy hub
A Get Satisfaction support page within your Facebook communityWith Get Satisfaction, the fan page is transformed into a powerful source of social knowledge that extends far beyond Facebook. Just as on your wall, the Get Satisfaction App allows customers post questions, feedback, concerns, praise … but before they post, we’ll search all the community and display the conversations, answers, and responses right there inside Facebook. If they post a new topic, that too becomes a part of the Get Satisfaction community.
Leverage the power of Facebook fans — your most social customers — to become a part of your larger customer community. Because all this social content is hosted in the Get Satisfaction platform, it is highly optimized for search engines and can also be syndicated on your website or pushed into your CRM. This new actionable intelligence delivers valuable consumer insight that ripples throughout the organization and into customer service, consumer relations, sales/marketing, R&D, and product development.
Those who already have a Get Satisfaction community and a Facebook fan page can chose from two integration plans:
Social Engagement Hub on the Facebook Fanpage
A custom integration for brands and high volume communities that lets you fully brand the community experience inside Facebook fan pages with:
- Brand customization and banner real estate in the fan page community
- Configurable viral post messaging to maximize acquisition of new fans
- Customizable tab name
- And much more, available upon request…
Support Tab on the Facebook Fan Page – Coming Soon!
The simplest and most effective way for small and medium companies to use the Fan Page App to support their customers on Facebook.
Coldfusion: 5 Simple Steps to Publish on Facebook Wall using Coldfusion
Filed under: Coldfusion, FaceBook Integration, Facebook, Featured, Technology News
There are two different Libraries available for Coldfusion to publish on facebook.
According to facebook Wiki posting on a wall is very confusing and very difficult to write a program to publish on a wall.
I spent around 2 weeks reading many articles and many documents, Wiki on facebook but in vein and tried many ways and finally I got one workable model. Below are 5 simple steps to publish on a Facebook wall.
Step1: Login to Facebook
First login to Facebook and goto the url http://www.facebook.com/developers/ then
Click on “+ Set Up New Application” button to start creating the application as shown below.

Provide the application name, click agree for facebook terms and click on “Create Application” button.
Fill in application Name

Now Application is created for you. Just copy the Application API Key, Application Secret and Application ID details which will be used to write the application code.

Now goto Canvas link and enter any url.

Next goto Connect URL link and enter the same url.

Then click on Save. That’s it we have created a facebook application with an Iframe.
Now Copy Application API Key, Application Secret and Application ID details which will be used to write the application code.
For use with FBML
- Dominic Watson has created a starter template specifically for users wanting to use FBML. You can download it from RiaForge here: http://fbmlstarter.riaforge.org/
For use with iFrames
- REST compatible CFC: http://www.nearpersonal.com/code/ If you know how to use CFC’s and CF objects, this will really speed things up.
- Also – Cory Johnson has Created a quick and dirty starter application : http://www.dragonflybytes.com/blogger/index.cfm/2007/6/13/Coldfusion-Facebook-REST-API-Example
Step2: Generate One Time Session key
How to generate One Time Session key:
Run below URL to get temporary token for the selected user by logging into Facebook.
https://login.facebook.com/code_gen.php?api_key=API_KEY&v=1.0
Note: Please replace “API_KEY” with your application API key from above page.
Then we will get a temporary token key.



This is one time token key that we can use to generate a permanent session key. Careful! Don’t try to execute this programs many times
Step3: Generate one time session key
Below is the sample code to generate one time session key.
For example, the full URL for logging in a user could be:
If the user is redirected to the URL specified by the next parameter, then Facebook grants your application a session. This session is appended to the URL as a JSON-decodable object of the form:
In continuing with the above example, the redirect for a successful login would be:
If the user grants your application the offline_access extended permission, 0 gets returned for expires and the session never expires unless the user removes the application. In this case, you should store the session key so the user doesn’t have to log in the next time he or she launches your application.
Once the browser has been redirected successfully and you have your session information, you should automatically close the browser window.
Note: The above code will execute only once. We should note down the above session key, This will be used to auto login into the application.
If you don’t save these session key values you should generate other token key to create one time session key.
Step4: Setting Permission for wall
Giving Permission to your application to publish on facebook wall. To give permission just replace the your API key in below URL and execute in browser.
Then you must see the below 3 Screens
If you don’t see the below then your call back URL or Canvas URL must be incorrect, please check again your application settings and execute the URL again.


Then on final page, you will see a success message. That’s it you have given permission for read_stream,publish_stream and offline_access.
Step5: Publishing the message with Image and link on Facebook Wall using ColdFusion
Publishing a Post With Image and Action Link using Coldfusion
ColdFusion Code to create facebook object with onetime session key and publishing the message on Facebook Wall.
<cffunction name="publishStream" access="public" output="false" returntype="any" hint="Publish Steven on Facebook">
<cfargument name="session_key" type="string" required="true" hint="SESSION_KEY">
<cfargument name="to_ids" type="string" required="true" hint="ids of all the friends user has chosen">
<cfargument name="message" type="string" required="true" hint="publish steven on facebook">
<cfargument name="attachment" type="Any" required="true" hint="JSON Object">
<cfargument name="action_links" type="Any" required="true" hint="JSON Object">
<!--- local vars --->
<cfset var params = StructNew() />
<!--- the api call --->
<cfset params["session_key"] = arguments.session_key />
<!--- <cfset params["uids"] = arguments.to_ids />--->
<cfset params["message"] = arguments.message />
<cfset params["attachment"] = arguments.attachment />
<cfset params["action_links"] = arguments.action_links />
<!--- Invoke stream.publish API --->
<cfset sendNoteVar = xmlToStructParam('facebook.stream.Publish',params) />
<cfreturn sendNoteVar />
</cffunction>
In the above code there is not necessary to have the action link and attachment URL. If you would like to only publish any image then you need to give that two params.
Now you will see the post on wall Great.

So thrilling isn’t we can also publish photos videos on wall.
http://wiki.developers.facebook.com/index.php/Stream.publish
More information on ColdFusion can be found here http://cffacebook.wordpress.com/
have a great day
– Steven
Please don’t copy this content to any site. This is fully protected by TheUnical Technologies







