Twitter App ShortenURL Function

From ADF Docs
Revision as of 19:34, 16 August 2010 by Cmora (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

The twitterService component contains a few functions you can take advantage off in your custom scritps. One of these functions is the shortenURL function.

Setup

1. It is installed as part of the Twitter application's installation.

Demo

To set up a demo of the Follow Button custom element, follow these steps:

  • Create a new CFM file inside one of your subsite's customcf folder.
  • In this file add the following code:
<cfoutput>
#application.twitter.twitterService.shortenURL('http://something.com/some/long/url.html')#
</cfoutput>
  • Create a new page and place a Custom Script element on the page.
  • Click the 'Edit' button.
  • Select or type in the path to your new custom script.
  • Submit the changes to the page.
  • On the page you'll see the shortened URL, something like this:
http://bit.ly/abcdefg1234