Coldfusion: 5 Simple Steps to Publish on Facebook Wall using Coldfusion

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.

start application

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

Fill in application Name

create app step1

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.

application page

Now goto Canvas link and enter any url.

canvaspage

Next goto Connect URL link and enter the same url.

connecturl

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

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.

allowaccess

generatemylogin info

savemyinfo

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:

http://www.facebook.com/login.php?api_key=YOURAPIKEY&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&session_key_only=true&req_perms=read_stream,publish_stream,offline_access

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:

&session={“session_key”:”SESSIONKEY”, “uid”:USERID, “expires”:0 || UNIXTIME, “secret”:”SESSIONSECRET”}

In continuing with the above example, the redirect for a successful login would be:

http://www.facebook.com/connect/login_success.html?session=%7B%22session_key%22%3A%223.kxhAu6W0qo_bLGjmdWrgfw__.86400.1243443600-688626964%22%2C%22uid%22%3A%22688626964%22%2C%22expires%22%3A1243443600%2C%22secret%22%3A%220NVNMxpO6jVyDcVCvVv_PA__%22%2C%22sig%22%3A%22ac1c0c77c137567389defea70481b7aa%22%7D

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.

http://www.facebook.com/login.php?api_key=APIKEYXxxxxxxxxxxxxxxxxx&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&req_perms=read_stream,publish_stream,offline_access

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.

allowpermission

allowpublishing

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.

published on facebook

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

Simple 5 Steps to publish on a facebook wall using DotNet C#/ cSharp

There are many Libraries available for C# and Dotnet 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.

start application

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

Fill in application Name

create app step1

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.

application page

Now goto Canvas link and enter any url.

canvaspage

Next goto Connect URL link and enter the same url.

connecturl

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.

Now download any of the available libraries on facebook http://wiki.developers.facebook.com/index.php/User:ASP.NET

(OR)

Microsoft SDK for Facebook Platform, which supports Facebook Connect, FBML and IFrame canvas page applications, and ASP.NET MVC. For issues and discussions about the SDK see the project on Codeplex.

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.

allowaccess

generatemylogin info

savemyinfo

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:

http://www.facebook.com/login.php?api_key=YOURAPIKEY&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&session_key_only=true&req_perms=read_stream,publish_stream,offline_access

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:

&session={“session_key”:”SESSIONKEY”, “uid”:USERID, “expires”:0 || UNIXTIME, “secret”:”SESSIONSECRET”}

In continuing with the above example, the redirect for a successful login would be:

http://www.facebook.com/connect/login_success.html?session=%7B%22session_key%22%3A%223.kxhAu6W0qo_bLGjmdWrgfw__.86400.1243443600-688626964%22%2C%22uid%22%3A%22688626964%22%2C%22expires%22%3A1243443600%2C%22secret%22%3A%220NVNMxpO6jVyDcVCvVv_PA__%22%2C%22sig%22%3A%22ac1c0c77c137567389defea70481b7aa%22%7D

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:

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.

http://www.facebook.com/login.php?api_key=APIKEYXxxxxxxxxxxxxxxxxx&connect_display=popup&v=1.0&next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&fbconnect=true&return_session=true&req_perms=read_stream,publish_stream,offline_access

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.

allowpermission

allowpublishing

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 cSharp/ C#

Publishing a Post With Image and Action Link in C# using facebook developer toolkit v2

C# Code to create facebook object with onetime session key and publishing the message on Facebook Wall.

public void Post(facebook.API fbAPI, string appLink)
{
 string response = fbAPI.stream.publish( "publish steven on facebook.",
new attachment() {
name = "I am a good guy !", href = appLink, caption = "{*actor*} Steven Publish on facebook wall",
description = "Helping other people, I became a new good guy.", properties = null,
 media = new List<attachment_media>() { new attachment_media_image()
{ src = "http://blog.theunical.com/wp-content/uploads/2009/11/start-application.jpg", href = appLink } } },
new List<action_link>() { new action_link() { text = "Become a good guy",
 href = appLink } }, null, 0);
}

Now you will see the post on wall Great.

published on facebook

So thrilling isn’t we can also publish photos videos on wall.

http://wiki.developers.facebook.com/index.php/Stream.publish

have a great day

— Steven

Please don’t copy this content to any site. This is fully protected by TheUnical Technologies

Now Yahoo Contacts Gets Facebook Connect

Last December, Yahoo announced that it would be rolling out a deep integration of its products with Facebook Connect, essentially outsourcing all things social to the world’s most popular social network. Today marks one of the initial demonstrations of this partnership, with Yahoo Contacts now connected to Facebook.

Now Yahoo allows you to add your Facebook friends’ email addresses to your Yahoo Contacts via Facebook Connect. In the Import Contact landing page of your Yahoo account, you’ll be able to select Facebook (importing from Gmail and Hotmail already exists). Once you authorize the connection with your Facebook credentials, your friends’ email addresses from their Facebook profiles will be added to your Yahoo Contacts. Yahoo will scan the imports and delete any duplicates.

As we’ve written in the past, Yahoo’s move with Facebook shows that the company has given up on leveraging the existing social connections among Yahoo email, address book and messenger users, and thus, weakens its ability to monetize this social graph. And Yahoo also just added Twitter integration to its products as well. While Google’s Buzz may have its problems, at least Google is making an effort to try to develop technologies that use its communications products to build a social graph. Perhaps Yahoo CEO shouldn’t bite the hand that feeds her.

Now Google Real-Time Search Now Includes Facebook Status Updates

Google has just announced via tweet that it’s integrating Facebook Page updates into its real-time search results. Google first revealed that this was coming back in December, when it first started including real-time data in its search results. Other data sources for Google’s real-time results include MySpace and Twitter.

googlefacebook

The only problem with the new addition is that Facebook is only granting Google access to updates from its 3 million Pages, which are generally for celebrities, politicians, brands, and local businesses — not your average Facebook user. That information could occasionally be useful, but the power of real-time search comes from having a large number of contributors. Facebook has a huge amount of data from its 400 million active users, but it isn’t sharing most of that with Google. Instead, it’s only granting full acess to user updates to Bing (though that isn’t live yet).  Bing will still only be getting status updates that are shared with /06/24“Everyone“, but with its recent privacy overhaul in December, Facebook ensured that it would have far more of those than it used to.

Unlike Twitter, which is reportedly making money off of its search deals with Bing and Google, Facebook isn’t charging the search engines for its data. According to Danny Sullivan at Search Engine Land, Facebook is giving away the status updates because they may drive more people back to the social network.

Facebook background Checks-In On Loopt

www_loopt_com

Facebook has been doing background checks, known as due diligence, on the location-based social network Loopt, a source with knowledge of the talks tells us. Generally speaking, due diligence of this kind is only performed when a company is in acquisition or fundraising talks.

Loopt won’t comment on this story, and a Facebook spokesperson says “As a practical matter, we don’t comment on rumor and speculation.”

There is no indication that Facebook has made an actual offer to buy Loopt at this time, and in fact we don’t even have direct information that negotiations are taking place. But it’s clear that Facebook is at least considering acquiring Loopt, and/or others in this space.

It’s also not clear that Facebook is the only company taking a look at Loopt. Google is also highly interested in the mobile social and location space. Their recent launch of Buzz, which allows check-ins of locations via a mobile device, is just one indication of that.

But Facebook is clearly furthest behind. They have one of the most popular mobile applications but have to date ignored location features and the increasingly popular checking-in at locations via mobile devices. Part of their hesitation is likely due to privacy concerns around disclosing location information, even at the user’s request. But they’ve also clearly just sat on the sidelines as well as the space developed, and recently surged in activity.

It’s time for Facebook to make their move. Jupiter Research recently stated that location based services could generate nearly $13 billion in revenue by 2014. Facebook wants their share of that.

Loopt competitors like Foursquare and Gowalla have the biggest press footprint with mobile location applications, getting lots of attention from the early adopters in Silicon Valley. But Loopt has the most users by far. And they also have longstanding carrier relationships that bring in real revenue.

Loopt was one of the hot location-based networks early on, with founder Sam Altman even getting stage time during the initial App Store unveiling event. But Loopt, like Google’s Latitude, was intially built around the “always-on” idea of location. This is something that hurt it because the iPhone did not allow third-party applications to run in the background. Meanwhile, “check-in” based services like Foursquare and Gowalla grew in popularity. Loopt has since repositioned itself as more of a check-in based service, but despite its large user base, it’s not clear if its users will adapt to this change.

Potential advertisers pitching them about a new app completely built around the idea of check-in specials. Notably, this app was to be entirely built on top of Facebook’s social graph, utilizing Facebook Connect. This app is an offshoot of GeoGraffiti, a Y Combinator startup that Loopt itself acquired last year.

Facebook Launches Zero, A Text-Only Mobile Site For Carriers

At the Mobile World Congress 2010, Facebook’s Chamath Palihapitiya just finished a 20-minute keynote, outlining the social networking juggernaut’s mobile strategy. We’ll have a video of the full presentation up soon.

There were no major announcements, but Palihapitiya did introduce something interesting that hasn’t been publicly announced yet: Facebook Zero.

When you visit the URL zero.facebook.com using your mobile’s browser, you’ll see a notice that your carrier does not yet support the service – obviously because it was just launched and operators have yet to sign up.

Palihapitiya only touched on it for a couple of seconds, but from what I gathered it’s basically a text-only version of the Facebook service that carriers can offer to their subscribers at no charge. If a user then decides to switch from text-only to multimedia (e.g. view photos from their friends), mobile operators can start charging them for ‘premium’ data service.

This system is apparently called zero-rated pages, and allows operators to use a trimmed down version of a web application as a sort of teaser, driving the adoption of certain mobile services or apps, and more data usage revenue down the line.

Presumably, Facebook will offer Facebook Zero to carriers for free, since it helps them make the social network as ubiquitous on mobile phones as possible.

We have an e-mail in with Facebook PR for more information.

Update: Facebook spokesperson Brandee Barker writes back:

“Zero” is a light-weight version of m.facebook.com that omits data intensive applications like Photos. It will launch in coming weeks and we are discussing it at MWC as an option to make Facebook on the mobile web available to everyone, anywhere and allow operators to encourage more mobile Internet usage.

On the Web, Conformism Is the New Revolutionary « Web Poduzetnik

Today I ran into the Facebook status of an old schoolmate of mine who is now your run of the mill early adopter/IT guy: Groups will form, petitions will be signed. “No to the new facebook!!” In 6 months time no one will remember what it


Web Poduzetnik – http://www.web-poduzetnik.com/

Funny Facebook Status Messages and Posts – FailbookingIt's magic. «

I'm surprised that she could figure out how to even log on to facebook to update her status… Reply. Lawlcat says: February 6, 2010 at 8:20 am. Lmao…some people shouldbe sterilized for the sake of humanity.


Funny Facebook Status Messages… – http://failbooking.com/

LOOP GALLERY: How I Learned to Love Facebook by Charles Hackbarth

It's 6 am and I've just woken from a dream in which I'd written the most clever facebook status update in the history of electronic networking. Unfortunately, the content of that update had vanished like vapours on a windshield.


LOOP GALLERY – http://loopgallery.blogspot.com/