Wednesday, August 31, 2011

Facebook + ColdFusion

Ok, been working on this off and on now for a few months.  I had an old FBML Facebook Application that I wanted to convert over to the Graph API since FBML is going to go away at some point.  I got stuck on a number of bugs and I wanted to pass along the solutions to each here.

#1. A very odd / old ColdFusion error message about a missing form variable --- This is a relic back to ColdFusion 3.1 which will disappear soon, however if you aren't thinking straight or are programming after mid-night this one might catch for a while.  Thanks to Ray Camden for a very useful blog post which helped me with a very simple solution to this problem.

#2. Finding and parsing the cookie which holds the keys to the OAuth castle.  Again I stumbled across a useful blog post which helped me over this hurdle. (look for Cookie.fbs_[your app id])

After getting through these two problems, the rest seems pretty straight forward and just requires a bunch of JSON parsing.

The Facebook Graph API Explorer is very helpful for putting together your requests and seeing what is going to be returned.

The Facebook API Docs are also useful.  It would be helpful if their were some ColdFusion examples in there, but it seems that Facebook favors PHP.

Tuesday, August 30, 2011

Suppressing white space being added when using CFFUNCTION

I have run into this several times and I am sure others have as well.  I wrote a nice little CFFUNCTION to get rid of some redundant code.  Write the function, implement the function and now my output is broken because of some extra spaces showing up in the page now.  Duh, forgot to set output="false" on the CFFUNCTION tag, done this a bunch of times and will probably do it every once in a while still.  Maybe this post will cause me to stop doing it and commit it to permit long-term memory...

A bit more of an example...

<cffunction name="GetDuh" returntype="string">
<cfset returnvar = "duh" />
<cfreturn returnvar />
</cffunction>

This is a big ...#GetDuh()#... moment

returns: This is a big ... duh... moment

Change <cffunction name="GetDuh" returntype="string" output="false">

returns: This is a big ...duh... moment



Sunday, August 28, 2011

ColdFusion eBay SOAP Calls

I wanted to do some eBay automation and couldn't find any really good examples of doing ColdFusion SOAP calls to the eBay API, so I decided to roll my own.  What I have posted out on GitHub is not complete and doesn't cover the entire feature set of the eBay API, it is intended to be a starting point for a project as it does cover the basics of communicating with the API.

Here is a link to the GitHub respository: https://github.com/tigeryan/ColdFusion-eBay-API---SOAP-Calls

Please let me know if you have any comments or questions...

Saturday, August 27, 2011

How I got started with ColdFusion

I know I am a little late to the game on this topic, however better late then never.

I had just left a trucking company where I was doing SysOp work on an AS/400 including RPG/400, CL/400 and various PC support activities and had joined a small WebDev shop by the name of DESIGN/fx.  They needed an HTML coder, but soon found themselves in need of a second programmer.  I volunteers to step up and fill that role.   At the time we were using a language by the name of iPerform, iPerform was a windows scripting language that ran as a CGI inside of IIS.  It was clunking and really didn't perform, but it was what we had at the time.

We were in the middle of a project to launch a community portal, South Jersey Online, when we came across this new CGI language called ColdFusion.  We downloaded the trial and did some initial development with the product and found we could do things 10 times as fast as we could with iPerform.  We went to management and told them we wanted to restart the project that was weeks from launch using this new technology, reluctantly we got their approval to do so and we quickly went to work.  Six weeks later we had a functioning site, with administration tools, that went into beta and launched shortly thereafter.

A couple of months later the first boxed version of ColdFusion was released and I have never looked back, having used every major and minor release of the product.

Thank you to the Allaire brothers and everyone else who has shaped the language along the way to where we are now.