Tonight I published an update to my Craigslist Spam Buttons greasemonkey script. (If you don’t know what this is about, see my earlier post). I’ve had some feedback on the script, and I was able to incorporate those requests. Now the [spam] buttons are displayed at the front of item link. And when you click on the link, a request is made in the background to mark the item as spam. You no longer have to jump to the flag-spam page, then click the continue browsing button to get back to where you were. Instead the [spam] button changes to a red check mark to indicate that it has been marked.
This is more difficult than you would think, you can’t just do a simple AJAX request because your browser will only make requests to the same site you are on. In this case you are browsing on yourcity.craigslist.org, but the flag-spam page is on flag.craigslist.org.
The greasemonkey extension does provide a built in method to make http calls to external sites, but that would break my Opera compatibility. So instead I load the flag-spam page as the src of a JavaScript-created image object.
It was fun to figure out, I really enjoy programming in JavaScript.
You can get the script from userscripts.org. Here is a screen shot:
Posted by Ryan Stille on November 8 2007 at 10:08 pm under Misc, Web Development.
81 Comments.
Check out this awesome pumpkin carving done by my boss, Mark Kruger. It’s a perfect depiction of our company logo.
(click the image for a hi res picture)
Here is the actual logo:
Posted by Ryan Stille on October 31 2007 at 8:46 am under Misc.
Comments Off on Happy Halloween – check out this awesome CF pumpkin.
I encountered a problem (or should I say an “opportunity”) where I needed to do some rounding in a query-of-a-query. This is normally very easy to do in most RDBMS, as there is usually some type of Round() function you can use. In my case I needed to round a percentage I was calculating in the Q of a Q down to only 1 decimal place. And I didn’t even really need to round it – I would be ok with simply truncating. Turns out this is a little difficult to do in a query of a query. There are no round() functions, no ceiling() or floor(), and no string manipulation functions. Here is what I came up with:
Continue reading ‘Rounding values in a Query of a Query’ »
Posted by Ryan Stille on October 24 2007 at 4:19 pm under ColdFusion, Web Development.
Comments Off on Rounding values in a Query of a Query.
A few months ago I decided to go on a book binge and acquired a stack of books about two feet tall. It includes classics such as The Pragmatic Progammer and Practices of an Agile Developer, as well as some on Java, Asterisk, Extreme Programming, Linux Firewalls, and a NASCAR book thrown in for good measure.
I’ve gotten through a couple, and will be posting reviews of a few of them. This week I finished Apache Security, from O’Reilly. I found this book while browsing the programming section of Borders (the programming section of my local Borders is amazing!), and I’ve found it to be a real gem.
Continue reading ‘Book Review – Apache Security’ »
Posted by Ryan Stille on October 11 2007 at 6:38 pm under Book Reviews, Linux, System Administration, Web Development.
Comments Off on Book Review – Apache Security.
A few weeks ago I had to interface to Authorize.net’s recurring billing API. This is a new API they released early this year. Prior to this, if you wanted a recurring billing subscription setup, you had to log into their site and set it up manually.
When I went to begin coding I searched high and low for an existing custom tag or cfc, but did not find any. So now that mine is complete, I’ve posted it on RiaForge.
ColdFusion CFC for Authorize.net recurring billing API
There is a README file in the zip archive that has fairly detailed instructions, but here are the basics:
Continue reading ‘Authorize.net recurring billing API CFC’ »
Posted by Ryan Stille on August 18 2007 at 6:49 pm under ColdFusion, Web Development.
27 Comments.
Or – Resolving the ColdFusion Content is not allowed in prolog Error.
If you’ve tried to consume web services with ColdFusion, you may have run into this issue when attempting to use the returned XML. I’ve seen this crop up when simply pulling in an RSS feed as well. Often there are some strange characters at the beginning of the XML response. We can see the problem if we use Firefox to browse to the Authorize.net web service:
Continue reading ‘Cleaning up those funny characters on an XML web service result’ »
Posted by Ryan Stille on July 9 2007 at 9:49 am under ColdFusion, Web Development.
5 Comments.
We had a need to do a case sensitive SQL comparison this week. As part of a login process a user is prompted for an answer to their security question. Now I really don’t think forcing users to enter their employer’s name in the exact case does anything to keep out hackers, but the client wanted it done this way.
Of course we could pull the values into ColdFusion and do a case sensitive comparison with Compare(). But the code was already setup to do the comparison at the SQL level, which is usually a better idea anyway if it can be done.
There are several ways to tell MS SQL to do a case sensitive comparison. Continue reading ‘Case sensitive comparisons in SQL’ »
Posted by Ryan Stille on July 3 2007 at 9:53 am under SQL, Web Development.
5 Comments.
When building an application that uses an Application.cfc file, many times the OnApplicationStart() method is used to initialize Application scope variables.
Since this method is only called once until the next server restart, its safe to set your Application variables here without using cflock tags. A common implementation may look like this:
<cffunction name="onApplicationStart" returntype="boolean">
<cfset Application.dsn = "myDSN">
</cfset><cfset Application.smtpserver = "localhost">
</cfset></cffunction>
But what happens when you need to change one of those variables? For example if you change the Application.smtpserver value to “newhost.com”, and save the file, Application.smtpserver will still be set to localhost. Restarting the ColdFusion server will force the OnApplicationStart() method to be called again, thus loading in your new value, but that is a little drastic.
Continue reading ‘Providing feedback when forcing a refresh of the Application scope’ »
Posted by Ryan Stille on June 18 2007 at 9:34 pm under ColdFusion, Web Development.
9 Comments.
Tonight I gave an “Intro to ColdFusion” presentation at the Omaha Dynamic Language Users Group. As promised, here are the links from my Resources slides. The full presentation is also available: Open Office (1194Kb), PDF (560Kb)
Posted by Ryan Stille on June 5 2007 at 10:59 pm under ColdFusion, Web Development.
Comments Off on Introduction to ColdFusion presentation.
Tonight we had Adam Lehman from Adobe speak to our CFUG about Scorpio. It was very impressive! They’ve truly done an excellent job at making this a ‘must have’ upgrade. The UI tools, server monitoring, image manipulation, presentation generation, the list goes on. It was just one amazing feature after another. And I can finally use var++
to increment a variable! I have been waiting for this since I started using ColdFusion 4.5.
You can find the Scorpio Tour events on Adobe’s website: http://www.adobe.com/products/coldfusion/events/
Posted by Ryan Stille on May 1 2007 at 9:32 pm under ColdFusion, Web Development.
3 Comments.