TwitterTweets: My First Plugin For the ColdFusion-Powered Mura CMS

This is my first attempt at building a Mura CMS plugin, so as you can imagine, this is going to be pretty darn simple. This plugin was actually inspired by a blog post I wrote back in March 2009 about using ColdFusion's CFFeed to display twitter tweets. If you like it ... great! If not, sorry I disappointed you.

The plugin will allow you to display the most recent tweets on your site(s). No knowledge of ColdFusion or programming should be required! However, if you are comfortable with .css, etc.then you'll be happy to know the tweets are displayed within a div id of "twitterTweets" and the tweets themselves are output in an unordered list, so you can style to your heart's content.

If there are tweets available via the twitter search interface, then you should be able to see output. If not, or if the tweets are more than a few weeks old, then you will see a message stating that there are no tweets available.

Installation

  1. Login to your Mura CMS admin
  2. Go to "Site Settings" (upper-right on the yellow bar)
  3. Select the "Plugins" tab
  4. Browse to the location of the TwitterTweets.zip file (don't unzip the files! Mura will do this for you. Unless, of course, you want to poke around the code.)
  5. Click "Deploy"
  6. You need to enter you twitter username. For example, if you visit http://twitter.com/stevewithington, then "stevewithington" is your username.
  7. Under "Site Assignment" be sure you select which site(s) you wish to apply this plugin to
  8. Go to the "Site Manager" of the site you wish to display this on
  9. Select a page to edit
  10. Select the "Content Objects" tab
  11. From the "Available Content Objects" dropdown, select "Plugins"
  12. Then select "TwitterTweets" and choose which area to display on by clicking the ">>" button
  13. Click "Publish"

Optional settings at this point are merely how many recent tweets to display and whether or not you want to show a title above the tweets.

Need help?

Catch me on the Mura CMS forums or contact me through my site.

Cheers!

Edit

I was asked about using more than one twitter username and how to handle the plugin for multiple sites. The answer is actually quite simple. All you would have to do is install and deploy TwitterTweets again. This would allow you to have multiple installs, each with their own username, etc. This also gives you control over which install goes to which site(s).

I am considering including the ability to have multiple usernames for one install though.

Any other suggestions?

Use ColdFusion's CFFeed to Display Your Twitter Tweets (and more!) on Your Blog in 30 Seconds

As Twitter's popularity continues to increase, users and consumers of the information being broadcast are looking for quick and easy ways to integrate some of the information into their own content. So I whipped up this short, but sweet, example of how easy it is to repurpose content from Twitter using just a dash of ColdFusion.

First things first though, what makes consuming information from Twitter so easy is their search functionality. Check it out at http://search.twitter.com. By following the instructions there, you will see that anything you search for can be "burned" via RSS. After your search, following the link "Feed for this query" and viola! Instant RSS feed you can now consume. How sweet it is.

What's really cool is that if you search for let's say "stevewithington" you can see not only my posts, but also any responses too. If you only want to see tweets "from" me for example, then you simply put "from:" in front of your search criteria such as "from:stevewithington."

For sake of simplicity, I'm going to just follow the "Feed for this query" link and continue on.

If you're using ColdFusion 8, then all you have to do is use CFFeed to consume the feed. Here's a sample line of code:


<cfset feedurl="http://search.twitter.com/search.atom?q=from%3Astevewithington" />
<cffeed
    source="#feedurl#"
    properties="feedmeta"
    query="feeditems" />

If you're curious as to what the feed contains, you can always use CFDump to find out:


<cfdump var="#feeditems#" label="feedItems" />

Using the above line of code, you should see something similar to the following:

As you'll see, CFFeed creates a very nice query object containing quite a bit of information for you. One field of interest at this point is the "CONTENT" field which contains HTML-formatted code for each tweet. If you prefer a "text-only" version of the tweet, then simply use the "TITLE" field. So, to show how easy this is, let's just loop over the feed items and output the "CONTENT."


<ol>
<cfoutput query="feeditems">
    <li>#content#</li>
</cfoutput>
</ol>

Running the above line of code, you should see something like this:

I know, I know, you're probably thinking, "there's got to be more to it, right?" Well, there is if you want there to be! Using CFDump, you saw all kinds of information you can repurpose to your heart's desire. Think up new ways to use Twitter and with ColdFusion's CFFeed you can create new ways to consume it's easy-to-integrate-and-embed information.

It's an Adobe Twitter Directory!

Serge Jespers (an Adobe platform evangelist) has put together a fairly comprehensive "Twitter Directory" of Adobe peeps. Thanks Serge!

Go get your Tweet on!

Addition: Here's another list of Adobe Flex-India community on Twitter as well.

© 2024, Stephen J. Withington, Jr.  |  Hosted by Hostek.com

Creative Commons License   |   This work is licensed under a Creative Commons Attribution 3.0 Unported License.