English-Friendly Interval Calculation

I am working on a small program to digest and store RSS feeds (in part using Ray Camden's nice RSS.cfc). One thing I ran into is that I want to be able to specify how frequently feeds should get updated. It seems obvious that I should have an argument for this in the init() method of my CFC. What I don't want, however, is to either limit myself to one interval (days, for example) or to have multiple arguments just for the interval.

Moreover, I really want to be able to specify the interval in a human-readable format. So, I created a UDF (implemented as a method in my CFC) to make date calculations based on a readable string indicating the interval.

Here are some examples of intervals that it will calculate:

  • daily
  • annually
  • every day
  • every other minute
  • every 3rd quarter
  • every fourth year
  • every other Saturday
  • 4th Saturday
  • three weeks
  • 2 months, 2 days, 11 minutes
  • - every second Sunday

Most of these should be pretty obvious, but the last two might require a touch of explanation. The UDF will accept a comma delimited list, in which case it will apply all of the intervals to the date given.

If the interval starts with a "-" then it will subtract the interval given. The subtraction will only apply to the entire interval, not to single items in the list.

[More]

Adding Fields to StarterCart

Every shopping cart that I have tried or reviewed has some generic fields in their products that are meant to handle any product data that wasn't otherwise covered by their existing fields. I never liked this approach. It makes the GUI user somehow responsible for data structure and probably doesn't eliminate the need for custom code anyway.

With StarterCart, I took a different approach. Instead of having several product fields as well as some generic fields, I have only the bare bones - fields for the name, price, description. I honestly debated about whether or not to include a description field.

So, how do you add fields?

[More]

New Open Source ColdFusion Shopping Cart

I have tried a handful of ColdFusion shopping carts and I have never been happy with them. They tend to do more than I need, but not in the way that I need it. That they don't work quite as I need isn't a problem. That they are difficult to modify is.

After a few frustrating experiences, I finally decided to build a shopping cart the way I always wanted one to work. The real difference between this cart and others is that it assumes that you will have to modify it. Rather than give you 90% of what you need and making it hard to do the other 10%, it gives you closer to 60% of what you need, but makes it extremely easy to get the other 40%.

The result is a free, open source, shopping cart program that I call StarterCart. While it is very slim on features, it does provide some significant advantages over other shopping cart programs that I have seen.

[More]

BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.