KinkyTwits - My ColdFusion And jQuery Powered Twitter Client

Posted October 6, 2008 at 9:10 AM by Ben Nadel

Tags: ColdFusion, Javascript / DHTML

Last week, I had mentioned on Twitter that I was gonna try to build my own Twitter Client for yucks (trying to attain true Geek status). I came up with "KinkyTwits". I put a good 12 or 13 hours into this over the weekend and I think I came up with some cool stuff. It's definitely rough and the code really needs to be organized much better, but it's working as a really basic Twitter client.


 
 
 

 
KinkyTwits - ColdFusion And jQuery Powered Twitter Client By Kinky Solutions.  
 
 
 

Watch the Demo Video Here

The backend is powered by ColdFusion, naturally, and MySQL. The front end is powered by jQuery. The whole thing is basically a single page application (what you see above). I tried to build this using a lot of Twitter feedback that I saw over the last few weeks. In particular, I got the feeling that people wanted:

  • Filtering based on patterns
  • Smart Groups
  • Snoozing

I tried to include all of that in this initial beta.

There's a lot of things that it doesn't have yet like TweetPics and URL shortening. But, I don't think those things would be too complicated to add. I am gonna continue working on this, see how it performs. If anyone wants the code, let me know.




Reader Comments

Oct 6, 2008 at 9:42 AM // reply »
11 Comments

Looks cool, Ben. I'm curious, are you running the back-end on a web server? I'm guessing so, because you say it's ColdFusion powered.

I've thought of doing something similar, but always come back to the idea that this approach could be a potential scaling issue if the app were to get popular.

Do you know if other AIR clients like TweetDeck and Twhirl use a back-end server, or if they interface directly with the Twitter API?


Oct 6, 2008 at 9:45 AM // reply »
11 Comments

I meant to include this in my previous comment: I've liked the grouping of TweetDeck, but it's always felt a little clunky to me. I'd love to try yours out for a while. Can you send me a copy?


Oct 6, 2008 at 9:52 AM // reply »
11,314 Comments

@Adam,

Yeah, it is running off a server. I thought about this for a while and I came to the conclusion that that was the way to go. For starters, its just a personal client, so I wouldn't except this to be run as a service for a large group of people (but I guess that could change).

But, mostly, what I like is that CF and MySQL act as the go-between. Meaning, the HTML/jQuery interface only feeds from the MySQL database. It *never* touches Twitter directly (except to post a status). The action of pulling Status feeds from Twitter and caching them locally is totally asynchronous to the main application. This allows me to apply all the filtering and grouping and organization. Sure, I suppose I could do that on the fly in there interface or during the call, but I would rather not.


Oct 6, 2008 at 9:52 AM // reply »
11,314 Comments

@Adam,

Sure, I'lll send you a copy.


Oct 6, 2008 at 10:02 AM // reply »
3 Comments

Hey! Nice work so far! Meets my needs directly.

Was wondering if I could take you up on your offer and get the code?

I'm trying to get my Wife's "Moms Club" up on twitter, and the real issue they have is they want the ability to have sub-groups (so they can include/not include certain other moms from certain tweets -- go figure). Your "groups" functionality looks to cover this issue nicely!

Thought I might take what you've done so far, and run with it!

Perhaps you could zip up the code and send it to the listed email address (or maybe you have a "package" link you could point me to or SVN repository?)

I could pay you if need be! Do you have an Amazon wish list?

BTW - have you noticed lately how all the online "social" issues resolve around they ability to _filter_ your relationships? I guess Clay Shirky nail it.


Oct 6, 2008 at 10:05 AM // reply »
11,314 Comments

@Robert,

I'll shoot you a copy. It's really rough right now. There is no session management or anything. It's really just a proof of concept right now. My Twitter login is actually hard-coded right in my Application.cfc file. I really wanted to see if this concept was even worth pursing. Now that I think it is, I will go back and refactor, make session management, etc.

That's said, I'll send a copy :)


Oct 6, 2008 at 10:09 AM // reply »
3 Comments

You wrote:

"But, mostly, what I like is that CF and MySQL act as the go-between. Meaning, the HTML/jQuery interface only feeds from the MySQL database."

If I understand you correctly, indirectly you cover the issue of Twitter taking back the "trac" abilities. Recording the stream (in your mySql) allows to gain back some of that capturing of the "firehose" stream for searching and aggregation.

That's a benefit!


Oct 6, 2008 at 10:16 AM // reply »
18 Comments

Hi Ben

This is fantastic, and as usual it holds your distinctive style on the page.
Please could I have a look at the source code?

Many thanks,

Matt


Oct 6, 2008 at 10:32 AM // reply »
11,314 Comments

@Matt,

Thanks man. I'll send it along.


Oct 6, 2008 at 10:43 AM // reply »
11,314 Comments

@Robert,

I'm not exactly sure what you;re saying, but yes, the firehose of Twitter statuses is copied to my local MySQL server, which is what feeds the interface. This actually helps me to simplify the filtering process greatly as I am really, behind the scenes, duplicating the Tweets for each group.


Oct 6, 2008 at 11:33 AM // reply »
32 Comments

Heck, if you are giving out the code I would love to take a look :-) I have been meaning to sign up for twitter so I cnow have a good excuse!


Oct 6, 2008 at 11:34 AM // reply »
5 Comments

Nice Ben!

Ive been working on a Twitter CF app for a few months now: TweepleTwak.com


Oct 6, 2008 at 11:39 AM // reply »
11,314 Comments

Some people have asked about the "multiple query" setting for this app. I am a huge fan of inserting and selecting in the same CFQuery tag. This needs to be set up in the MySQL data source in the ColdFusion administrator. See this post for more details:

http://www.bennadel.com/index.cfm?dax=blog:1209.view


Oct 6, 2008 at 1:50 PM // reply »
2 Comments

Fantastic !!!

Please could I have a look at the source code?

Many thanks,

Abul


Oct 6, 2008 at 1:51 PM // reply »
11,314 Comments

@Abul,

Thanks man. I'm gonna make some updates at lunch (add some debugging). I'll send you an update later today.


Oct 6, 2008 at 2:53 PM // reply »
11,314 Comments

Just realized that General and Direct messages are handled in COMPLETELY different ways, including totally different response format. It's lunch time, gonna see if I can karate shop these updates!


Oct 6, 2008 at 3:22 PM // reply »
11,314 Comments

@Abul et al,

I was able to update the app on my lunch break (and re-emailed to you). I fixed the Direct messages and added local logging for errors.


Oct 6, 2008 at 4:04 PM // reply »
11,314 Comments

Just a general note of caution:

Do not run my Twitter client along side your old one. This will eat up your API allowance very quickly! Regardless of mine, you should only ever use one Twitter client.

I learned that the hardway when I was developing and I exceeded my limit in about half an hour (rather than an hour). I was burning the candle at both ends.


Oct 6, 2008 at 4:24 PM // reply »
66 Comments

I saw your Tweets over the weekend and wondered if you would be sharing the code. Nice job Ben. Pretty cool! Gotta love jQuery + ColdFusion.


Oct 6, 2008 at 4:30 PM // reply »
11,314 Comments

@Steve,

I make no claims on the code, but if you want to see it, just let me know. It's been a lot of fun, thanks.


Oct 7, 2008 at 9:13 AM // reply »
148 Comments

Interesting! Now, if only there was a way to "mute" certain twitters, at least until after a certain event . . .


Oct 7, 2008 at 9:46 AM // reply »
11,314 Comments

@Lola,

You can "snooze" a user. Every time you click their "snooze" link, it increases their snooze length by another hour (with no limit to how many times it can be clicked). When a user is snoozed, their tweets get auto-filtered into the Snoozed group and do not show in the General Tweets.

I am working on updating my Groups to allow you to add Users to them, rather than just regex filters.


Oct 7, 2008 at 11:15 AM // reply »
66 Comments

@Ben,
Well if your in the sharing mood, sure! I'd love to see what you cooked up. Thanks!


Oct 7, 2008 at 11:17 AM // reply »
11,314 Comments

@Steve,

I'll send it over.


MCG
Oct 7, 2008 at 9:16 PM // reply »
3 Comments

Nice work! Now, if I could just get something that slick on my Windows Mobile....

Oh and love the app name. :)


Oct 18, 2008 at 3:21 PM // reply »
1 Comments

Hello,

Looks very nice, could I get a copy of the code source please...

Thanks


Dec 22, 2008 at 12:19 AM // reply »
5 Comments

Hi Ben,

Very sweet looking app. I am writing a Twitter app as an exercise in getting back into CF dev, initially just using the built in CF AJAX tags. I am having a lot of problems with layouts, flickering refreshes, and even incompatibility with the built in stuff (cfdiv vs. cfcalendar), so would really like to see your code to get a better idea of using jQuery.

TIA,
-Rob


Jan 5, 2009 at 12:06 PM // reply »
1 Comments

Very Nice Work!

I'm thinking developing japanese version of twitter like app for my family and friend in japan. This will be perfect for starting it.

Could you kindly share your genius code source please~

Thanks


Jan 5, 2009 at 12:08 PM // reply »
11,314 Comments

@Gocyclone,

This is on my list of things to share soon. Just working on cleaning up the code.


Mar 31, 2009 at 4:01 PM // reply »
4 Comments

Ben:

I've been running into a real issue with doing a simple Twitter update of late from a CFML powered site. Is your source viewable? What I'm trying to do should be easy but it simply isn't working for me and other CF/Twitter information sources on the web are few and far between.

If it is viewable, may I have a look at it? I'm really trying to get a good idea of what I'm doing wrong as opposed to looking for a prebuilt solution (although if your solution does the job, I'd like to discuss using it in my app with you).

Thanks in advance.


Apr 1, 2009 at 9:21 AM // reply »
21 Comments

@Craig, you might want to consider using something like this:

http://twitterclient.riaforge.org/

That will make posting to twitter from your CFML application a breeze.


Apr 1, 2009 at 11:03 AM // reply »
4 Comments

@Adam, thanks. I had run across that early on and it failed like all the others.

As it turns out, as I was posting this, I did discover the solution to my issue was a CFML language problem rather than anything I was doing incorrectly or anything like that. I have a workaround that looks like this:

<cfhttp url="http://twitter.com/statuses/update.xml" method="POST" username="#variables.Tusername#" password="#variables.Tpassword#" charset="UTF-8">
<cfhttpparam type="HEADER" name="Authorization" value="Basic #ToBase64(variables.Tusername & ':' & variables.Tpassword)#">
<cfhttpparam type="FORMFIELD" name="status" value="#variables.Tstatus#">
</cfhttp>


Apr 1, 2009 at 11:13 AM // reply »
21 Comments

@Craig, I wonder if Twitter recently changed their API. They've been known to do that. If you have specific problems, I would recommend logging them on the issues page for the RIAForge project. Not enough people do that. :)


CT
Mar 2, 2010 at 12:06 PM // reply »
1 Comments

Nice idea!

I am in need of a simple app like this so is there a way of getting a copy of it, please?

tia


Mar 2, 2010 at 7:53 PM // reply »
11,314 Comments

@CT,

I never quite got it working well; but, if you want to look at it, it's on my projects page:

http://www.bennadel.com/projects/kinky-twits.htm


Mar 9, 2010 at 1:27 PM // reply »
1 Comments

Hello Ben, congratulation for this great app. Could you share you code with me? I´m needing create this kind of interface in our intranet to tweet at our corporative twitter. Thank you.


Mar 2, 2011 at 5:42 AM // reply »
3 Comments

great application hope you me post more application. http://www.blogsome.com


Mar 2, 2011 at 6:03 AM // reply »
3 Comments

<cfhttp url="http://www.blogspot.com>SEO information</cfhttp>


Mar 2, 2011 at 6:04 AM // reply »
3 Comments

<cfhttp url="http://www.blogspot.com">SEO information</cfhttp>



Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Jun 19, 2013 at 2:01 PM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
I have coincidentally been beating my head against the S3 API for the last week or so. One big "gotcha" I had to work around was file names and paths containing spaces. Remember to URL Enco ... read »
Jun 19, 2013 at 1:27 PM
Using Slice(), Substring(), And Substr() In Javascript
very good article. By the way IE supports negative values in substr or slice in verson 10. ... read »
Jun 19, 2013 at 11:33 AM
Filter vs. ngHide With ngRepeat In AngularJS
In your assessment, is it correct to say that given a list of say 500 items its more performant to use the `ngHide` method over the `filter` method? ... read »
Jun 19, 2013 at 10:18 AM
ColdFusion Path Usage And Manipulation Overview
Anyone happen to know if the file created by getTempFile will be automatically removed at any point? Nothing mentioned in the docs, and restarting CF doesn't remove them, so it seems it needs manu ... read »
Jun 19, 2013 at 9:41 AM
Working With Inherited Collections In AngularJS
I actually just ran into this same situation with a demo I was putting together. Your implementation of multi-lvl $scope's > Mine :) ... read »
Jun 19, 2013 at 8:17 AM
My Experience With AngularJS - The Super-heroic JavaScript MVW Framework
@Prateek, to match a word or text you should use .toContain('word') that's a jasmine reference. website is : http://pivotal.github.io/jasmine/ ... read »
Jun 19, 2013 at 8:10 AM
My Experience With AngularJS - The Super-heroic JavaScript MVW Framework
Hi Guys, Actually i am doing e2e test of angular js of my project but i am not getting one thing that is how to press enter key through the test when my form is filled as i am not using a button but ... read »
Jun 18, 2013 at 9:20 PM
Mapping AngularJS Routes Onto URL Parameters And Client-Side Events
I couldn't find examples of passing multiple arguments using the when() routing statement so figured out through trial and error that you can pass multiple arguments using the following format: .whe ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools