<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Bit.ly URL Shortening Service ColdFusion API</title>
	<atom:link href="http://www.mattgifford.co.uk/bitly-coldfusion-api/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mattgifford.co.uk/bitly-coldfusion-api</link>
	<description>Matt Gifford aka coldfumonkeh - ColdFusion, CFML, jQuery and web development</description>
	<lastBuildDate>Thu, 16 Feb 2012 17:45:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Ed</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-97237</link>
		<dc:creator>Ed</dc:creator>
		<pubDate>Wed, 15 Feb 2012 10:01:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-97237</guid>
		<description>Hi,

Thanks for this, very useful! Just in case anyone else wants to use this in CF7:

1) CF7 doesn&#039;t have native JSON de/serialization, so download and install this:

http://jsonutil.riaforge.org/

2) Change line 351 of bitly.cfc from

&lt;code&gt;&lt;cfset var stuOAuthResponse =     {} /&gt;&lt;/code&gt;

to

&lt;code&gt;&lt;cfset var stuOAuthResponse =     StructNew() /&gt;&lt;/code&gt;

3) Assuming you&#039;ve installed the JSONUtil CFC in the same dir as bitly.cfc, change the handleReturnFormat() method&#039;s json case from this:

&lt;code&gt;&lt;cfcase value=&quot;json&quot;&gt;
&lt;cfif getParse()&gt;
&lt;cfreturn DeserializeJSON(arguments.data) /&gt;
&lt;cfelse&gt;
&lt;cfreturn serializeJSON(DeserializeJSON(arguments.data)) /&gt;
&lt;/cfif&gt;
&lt;/cfcase&gt;&lt;/code&gt;

to this:

&lt;code&gt;&lt;cfcase value=&quot;json&quot;&gt;
&lt;cfset JSONUtils = createObject(&#039;component&#039;,&#039;JSONUtil&#039;)&gt; &lt;!--- change as needed ---&gt;
&lt;cfif getParse()&gt;
&lt;cfreturn JSONUtils.deserializeFromJSON(arguments.data) /&gt;
&lt;cfelse&gt;
&lt;cfreturn JSONUtils.serializeToJSON(JSONUtils.deserializeFromJSON(arguments.data)) /&gt;
&lt;/cfif&gt;
&lt;/cfcase&gt;&lt;/code&gt;

Hope this helps someone!</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks for this, very useful! Just in case anyone else wants to use this in CF7:</p>
<p>1) CF7 doesn&#8217;t have native JSON de/serialization, so download and install this:</p>
<p><a href="http://jsonutil.riaforge.org/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/jsonutil.riaforge.org/?referer=');">http://jsonutil.riaforge.org/</a></p>
<p>2) Change line 351 of bitly.cfc from</p>
<p><code>&lt;cfset var stuOAuthResponse =     {} /&gt;</code></p>
<p>to</p>
<p><code>&lt;cfset var stuOAuthResponse =     StructNew() /&gt;</code></p>
<p>3) Assuming you&#8217;ve installed the JSONUtil CFC in the same dir as bitly.cfc, change the handleReturnFormat() method&#8217;s json case from this:</p>
<p><code>&lt;cfcase value="json"&gt;<br />
&lt;cfif getParse()&gt;<br />
&lt;cfreturn DeserializeJSON(arguments.data) /&gt;<br />
&lt;cfelse&gt;<br />
&lt;cfreturn serializeJSON(DeserializeJSON(arguments.data)) /&gt;<br />
&lt;/cfif&gt;<br />
&lt;/cfcase&gt;</code></p>
<p>to this:</p>
<p><code>&lt;cfcase value="json"&gt;<br />
&lt;cfset JSONUtils = createObject('component','JSONUtil')&gt; &lt;!--- change as needed ---&gt;<br />
&lt;cfif getParse()&gt;<br />
&lt;cfreturn JSONUtils.deserializeFromJSON(arguments.data) /&gt;<br />
&lt;cfelse&gt;<br />
&lt;cfreturn JSONUtils.serializeToJSON(JSONUtils.deserializeFromJSON(arguments.data)) /&gt;<br />
&lt;/cfif&gt;<br />
&lt;/cfcase&gt;</code></p>
<p>Hope this helps someone!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clark</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-10834</link>
		<dc:creator>Clark</dc:creator>
		<pubDate>Wed, 22 Sep 2010 17:49:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-10834</guid>
		<description>Hi Matt,

Thanks so much for this. I got it working quickly except for one thing that I probably should have figured out sooner - URL encoding.  You may want to build this in to auto encode the longUrl string.   I couldn&#039;t figure out why bit.ly kept ignoring all but the first URL variable!

I couldn&#039;t figure out how best to update your CFC so I just encoded the URL before passing it in.

Thanks again,</description>
		<content:encoded><![CDATA[<p>Hi Matt,</p>
<p>Thanks so much for this. I got it working quickly except for one thing that I probably should have figured out sooner &#8211; URL encoding.  You may want to build this in to auto encode the longUrl string.   I couldn&#8217;t figure out why bit.ly kept ignoring all but the first URL variable!</p>
<p>I couldn&#8217;t figure out how best to update your CFC so I just encoded the URL before passing it in.</p>
<p>Thanks again,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-6802</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 12 Aug 2010 15:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-6802</guid>
		<description>Hi Joh

Which version of ColdFusion are you running?</description>
		<content:encoded><![CDATA[<p>Hi Joh</p>
<p>Which version of ColdFusion are you running?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joh</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-6794</link>
		<dc:creator>Joh</dc:creator>
		<pubDate>Thu, 12 Aug 2010 10:46:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-6794</guid>
		<description>Please ignore the last comment, just found out that my version of ColdFusion is too old!</description>
		<content:encoded><![CDATA[<p>Please ignore the last comment, just found out that my version of ColdFusion is too old!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joh</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-6793</link>
		<dc:creator>Joh</dc:creator>
		<pubDate>Thu, 12 Aug 2010 10:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-6793</guid>
		<description>Hello,

I&#039;ve just found this wrapper and am trying to get it to work. I&#039;m using Marc&#039;s example above: #shorten.results[&#039;http://www.google4games.com&#039;].shortUrl#

but I&#039;m getting Variable SHORTEN is undefined.

Any idea what could be wrong?</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I&#8217;ve just found this wrapper and am trying to get it to work. I&#8217;m using Marc&#8217;s example above: #shorten.results['http://www.google4games.com'].shortUrl#</p>
<p>but I&#8217;m getting Variable SHORTEN is undefined.</p>
<p>Any idea what could be wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-4194</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Fri, 25 Jun 2010 14:56:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-4194</guid>
		<description>@Marc - 

glad you got it working. The apostrophes are necessary as you are referencing the literal string, whereas in the above example I was calling the variable instead. 

Both the same and both get the result at the end of the day.

Happy &#039;bit.ly&#039;-ing :)</description>
		<content:encoded><![CDATA[<p>@Marc &#8211; </p>
<p>glad you got it working. The apostrophes are necessary as you are referencing the literal string, whereas in the above example I was calling the variable instead. </p>
<p>Both the same and both get the result at the end of the day.</p>
<p>Happy &#8216;bit.ly&#8217;-ing <img src='http://www.mattgifford.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-4190</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Fri, 25 Jun 2010 12:09:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-4190</guid>
		<description>Works like a charm, many thanks for that.
The solution i&#039;m using, based on your comment:

#shorten.results[&#039;http://www.google4games.com&#039;].shortUrl#

So, the trick is in using the [&#039; anyUrl &#039;] apostrofes and brackets.</description>
		<content:encoded><![CDATA[<p>Works like a charm, many thanks for that.<br />
The solution i&#8217;m using, based on your comment:</p>
<p>#shorten.results['http://www.google4games.com'].shortUrl#</p>
<p>So, the trick is in using the [' anyUrl '] apostrofes and brackets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-4171</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Thu, 24 Jun 2010 15:45:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-4171</guid>
		<description>Hey Marc - 

thanks for the comment; always nice to hear when someone is using the wrappers :)

There are a few ways to access the struct within the results:

1. If you pass the URL into the shorten() method as a variable, then use that variable again to access the struct like so:

shorten.results[urlString].shortUrl

2. a slightly longer method, but using structFindKey() you can also access the data, bypassing the lengthy and unfriendly URL:

structFindKey(shorten.results, &#039;shortUrl&#039;)[1].owner.shortUrl</description>
		<content:encoded><![CDATA[<p>Hey Marc &#8211; </p>
<p>thanks for the comment; always nice to hear when someone is using the wrappers <img src='http://www.mattgifford.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There are a few ways to access the struct within the results:</p>
<p>1. If you pass the URL into the shorten() method as a variable, then use that variable again to access the struct like so:</p>
<p>shorten.results[urlString].shortUrl</p>
<p>2. a slightly longer method, but using structFindKey() you can also access the data, bypassing the lengthy and unfriendly URL:</p>
<p>structFindKey(shorten.results, &#8216;shortUrl&#8217;)[1].owner.shortUrl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-4169</link>
		<dc:creator>Marc</dc:creator>
		<pubDate>Thu, 24 Jun 2010 15:01:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-4169</guid>
		<description>Nice wrapper, thanks.

I do have a question: in the bit.ly shorten response above, how do i reference ( i mean: use it, show on screen, put in db) the shortened url?

I prefer using dot notation to reference API responses, problem here is the url (in your example scoth-on-the-rocks.co.uk) which is being used as a &#039;structkey&#039; (or key-name, don&#039;t know how its called) so dot notation becomes a problem (because of the backslashes, which break dot-notation).

This is probably very simple todo, any advice appreciated.</description>
		<content:encoded><![CDATA[<p>Nice wrapper, thanks.</p>
<p>I do have a question: in the bit.ly shorten response above, how do i reference ( i mean: use it, show on screen, put in db) the shortened url?</p>
<p>I prefer using dot notation to reference API responses, problem here is the url (in your example scoth-on-the-rocks.co.uk) which is being used as a &#8216;structkey&#8217; (or key-name, don&#8217;t know how its called) so dot notation becomes a problem (because of the backslashes, which break dot-notation).</p>
<p>This is probably very simple todo, any advice appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.mattgifford.co.uk/bitly-coldfusion-api/comment-page-1#comment-1780</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 10 Mar 2010 16:04:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattgifford.co.uk/?p=1180#comment-1780</guid>
		<description>Hey Andy

I actually noticed your project shortly after I&#039;d submitted mine. Great job!
Would love to collaborate on combining the two if possible.</description>
		<content:encoded><![CDATA[<p>Hey Andy</p>
<p>I actually noticed your project shortly after I&#8217;d submitted mine. Great job!<br />
Would love to collaborate on combining the two if possible.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

