May 2018


          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
 
FEEDS
 
ARCHIVES
 
RECENT ENTRIES
 
OTHER BLOGGERS
 
AGGREGATORS
 
SOCIAL NETWORKS
:: 03/17/2012 ::
Bitly, Flex, and ColdFusion 9
Return   Back To Top
I use bitly.com for shortening some of my URLs. There are API Libraries and Documentation for bitly, so it is possible to write your own bitly-related applications. In this post, I'll show you two examples of such applications - one built in Flex and AS3 and another in ColdFusion's CFML.

Flex-based version  Flex SDK logo:

The Flex-based version works like this:

  • Leveraging Flex and AS3, I put together a BitlyOHoney.swc that accepts four inputs - your bitly API credentials (bitly Username and bitly APIKey), a long URL, and the format of the response data (XML, JSON, and TXT). Once you register on the bitly.com site, you can retrieve your API credentials and use them to try out this example. Take a look at the API Libraries and Documentation for bitly for more information.
  • According to the API, all bitly APIs support an optional return format parameter. * Note that json is the default response format. but xml is also available. Some endpoints also support a simple txt format. While creating my example appication, I learned that the response format you use in applications need to be lowercase (xml, json, txt and not XML, JSON, TXT). Also, note that the format, txt, is not spelled text.
  • According to the API, long URLs should be URL-encoded. I use the escape(long URL) function in my Flex/AS3-based example.
  • In this version, I leverage a Flash-based SharedObject to locally store the Bitly API credentials, saving keystrokes for subsequent URL shortening generation.

Click to try out the Flex-based version.

ColdFusion 9 version  ColdFusion 9 logo:

The ColdFusion 9 version works like this:

  • A CFML-based page is used to collect four inputs - your bitly API credentials (bitly Username and bitly APIKey), a long URL, and the format of the response data (XML, JSON, and TXT). Once you register on the bitly.com site, you can retrieve your API credentials and use them to try out this example. Take a look at the API Libraries and Documentation for bitly for more information.
  • The CFML-based page calls a ColdFusion Component function that leverages the CFHTTP tag to 'GET' the bitly API response.
  • According to the API, long URLs should be URL-encoded. I use the URLEncodedFormat(arguments.longURL, "utf-8") function in the CFC to urlencode the long URL.

Click to try the ColdFusion-based version.

        Tip Jar:

 
 

canada goose femme pas cher Soldes Louboutin Chaussures Soldes Louboutin louis vuitton taschen outlet louboutin outlet uk billig canada goose canada goose tilbud goyard pas cher longchamp bags outlet Monlcer udsalg billige parajumpers YSL replica sac louis vuitton pas cher Canada Goose Pas Cher Canada Goose Outlet UK Moncler Outlet uk goyard replica bags polo Lacoste pas cher Bolsos Longchamp España Moncler Jakker tilbud Doudoune moncler pas cher Parajumpers Jakker tilbud Ralph Lauren Soldes Parajumpers Outlet louis vuitton replica Moncler Jas sale Billiga Canada Goose Jacka Canada Goose outlet Billiga Moncler Doudoune Canada Goose Pas Cher Canada Goose Pas Cher Louboutin Soldes Canada Goose Pas Cher Hemers replica Doudoune Canada Goose Pas Cher prada replica Canada Goose Pas Cher Canada Goose Soldes Doudoune Canada Goose Pas Cher Canada Goose Pas Cher Canada Goose outlet Canada Goose outlet Canada Goose outlet