I've been hinting at a little project the last few days and as I'm about to get on an airplane I thought now would be a good time to share. First let me share the URL and I know folks will just immediately link out, so please do me a favor and open this in a new window. I want to talk a bit about the project before you leave.
So first and foremost, let me just say that I'm not trying to compete with MXNA, Goog, or Feed Squirrel. For a few days now I've been thinking of how easy it would be to build a blog aggregagtor in ColdFusion 8. I decided to build a site that would serve as a proof of concept. So to be clear, this site is mainly for fun and to showcase ColdFusion 8 technology. With that in mind, I've provided a link in the FAQ to the source. You can download all the code and play around with it. Outside of that, be gentle. Again, if you want a real aggregator, you know where to go. If enough folks like it though I'll consider adding more features. (The "Preferences" page for example is totally empty.)
So with that in mind, let me talk a bit about the code behind this site. First and foremost, in my mind, a blog aggregator does this:
- Download RSS entries from various feeds
- Add unique entries into the database
- Present a "blended" view to the user.
Pretty simple, right? I started off working with Paragator. Paragator is my CFC based Aggregator function. Basically it takes an array of RSS feeds and grabs them all at once, using threading. (Well, not all at once, the server has a max number of threads.) So having the CFC meant 90% of my work was done.
Then I wrote a simple CFC to manage my blogs and entries. I used the OPML (list of blogs) feed from MXNA to seed my list of blogs. I then wrote methods to get all the blogs. This was then passed to Paragator (just a small note, I'm running a slightly modified version of the code). When the results come back, I use a method that will only insert new entries.
And that's it. 2 CFCs and a process page. Oh and one page to dump the results. Incredibly simple. The only really cool tags I used were cffeed and cfthread.
On the front end I did a bit of AJAX work. The Feeds page makes use of CF8 tabs. The main page uses cftooltip on the blog names to show their descriptions. I want to add a bit more AJAX to the front end, but I just don't know exactly where yet.
So thats it. Again - I wrote this for fun. If it takes off, great (another chance to slap some ads up! ;), but I mainly wanted to show off ColdFusion 8. Download the code and let me know what you think. And to be clear - my readers know my UI skills stink. The design you see on the blog is an open source one made by styleshout. (I have to admit - I liked it so much I almost reskinned this blog with it.)
Archived Comments
Very cool!
Great use of new CF8 features as well.
Maybe the MXNA folks could take your code and make MXNA run faster?
Ha ha ha:
"Currently 33 users are wasting time instead of working."
Ray, looks good. I assume it has some sweet CFThread and CFFeed usage. Can't wait to download and take a peek inside.
Very Nice Ray! My only complaint is that the titles of the posts dont stand out quite enough especially in the gray background posts.. maybe make the titles bold?
Keep up the great work!
Nice work Ray.
Nice work Ray. A question...what did you use to determine uniqueness? I think MXNA uses the GUID which changes whenever people update their blogs across versions or software which makes for the fairly regular "blog puking" as I call it when all the old posts suddenly show up at once. Goog uses the title from what I can tell which means that if you have two posts with the same title, the newer one doesn't show (which I noticed when my original open source update posts had the same name thus I added the date). Curious how you approach this problem.
Good job Ray,
I have been on MXNA for a while, and i'm on this one, Full As A Goog refuse to index me, I don't think they appreciate constructive critism.
I'm going to add it to my iGoogle feeds right away.
Awesome work Ray! If you can, please add a pingurl feature like MXNA which will automatically alert the aggregator of a new entry.
Hey Ray I think there may be a little problem, if you search for something and it returns one item it's not displayed.
If you search for "My little project - ColdFusionBloggers.org" It returns one item but doesn't display anything.
John, are you saying search fails if it returns 1 result only but works ok for 2+?
WOW - It's very fast !!
I know that CF8 is fast, but it would be nice to get the specs on the server the site is running on.
It's a dual core something or another w/ 2 gigs of ram.
It's doesn't work correctly if you search "getter" 8 results are returned but if you count them you'll see the script only outputs 7 posts. So if one result is returned nothing is displayed but the title show one result found.
Ray - Yes, John is correct. Another example: search for "onMissingTemplate Example"
Confirmed. Working on a fix now. I think its just a issue with my limit in the SQL.
Should be fixed now. The source zip isn't updated.
Cool Ray, can yuo updated us when it is updated. I would like to see the fix.
I can tell you now I will forget. The first was that in MySQL limit clauses, the start index is 0, not 1. Duh. I will NEVER accept that starting crap at 0 makes sense. I think it was a mistake and modern languages should take a stand against this. (I mean other languages since CF did the sensible thing.)
Cool stuff, of course, Ray. Here's an interesting point about such Ajax-driven interfaces, though.
Let's say one wanted to bookmark the results of a particular search. We can't, because the URL for the page never changed.
I suppose if one really did want to enable this, a small icon of some sort in the search pod could offer a link to a URL that would recreate the whole page and the given search string.
I don't expect you to change this, Ray. Just thought I'd share it while I notice.
I don't quite get your meaning here Charlie. I do re-use index.cfm for my search results, just like BlogCFC does. But that isn't an AJAX issue at all. It is just me reusing the same template. If your search returns N pages, the links show that I also allow passing the search term via the query string. So one change I could make would be to switch my FORM to a GET, although that's not technically valid. Either way - it isn't an AJAX issue though. Or are you talking about my _plans_ to add more AJAX? Or just AJAX driven search results in general?
Well, I think you may be reading more into this than I meant. I'm not referring to any previous discussions we've had about BlogCFC and bookmarking search results.
I simply meant that many who build such Ajax apps may create their CFDIV (or whatever control) so that all the server interaction occurs within that control, and the user would never see a URL changing (much like when one uses an iframe).
I was just bringing that challenge to people's attention. In your case, I see that indeed the next/prev links cause a regular page request (where the URL changes to reflect it). I just hadn't noticed that, so one could look at that link to get the URL to bookmark.
But if you had instead designed those next/prev links to refresh the control holding the results instead, then this issue I mention would be something to note.
I wasn't attacking any choice you made. I just thought it interesting to note that some Ajax apps may indeed do new page requests without exposing a (changing) URL to the user, that's all.
No no - I didn't take it as an attack. I just didn't get WHERE you were coming from in relation to what I said. You are _definitely_ right.
"We cool". :-)
Ray,
Out of interest, how are you finding CFFEED. Feed-Squirrel is centered around home-grown RSS parser, and I'm wondering if it's worth the switch when the server moves to CF8.
Neil
In general - I like it. But I have some problems with the way queries are made. If you look at Paragator, one of the things I do is copy values over into common columns. That way I can always use one column for the link, for example, no matter what feed type it is. In my humble opinion, CFFEED should have done this for me. Now _normally_ I think people will use hard coded FEED urls and won't be doing it dynamically like I am.
THere is also a bug with some feeds not reporting dates correctly. But in the 290 or so feeds I aggregate, this was a small minority.
All in all - I'm VERY happy it was added, I'd just tweak it a bit for CF9. :)
Thats good to hear, I vividly remember the time I spent trying to write the parser for the FS core.