May 02, 2007
At the prodding of
a friend, I recently "sold out" ;) and signed up for
Text Link Ads (under the sponsored links section to the left). While their site says it supports ColdFusion in the help, there is no ColdFusion code provided, so you are left rolling your own. With some help from code Todd provided me, I created a component and a BlogCFC pod for integrating Text Link Ads into your site and though this is "unofficial" code, I figured I would provide it in case someone needs it.It does differ from the official code I have seen as they usually cache your XML in a local file, but I am caching it in the application scope. It is technically ColdFusion 7 compatible, but if you need it to work on 6.1 you would just need to lose the result attribute on the cfhttp call.
Anyway, here is a snippet on how you would use the CFC - which you could use independent of the pod:
<cfparam name="url.reload" default="false" /> <cfif not structKeyExists(application,"tla") or url.reload> <cfset application.tla = createObject("component","org.tla").init("[your key here]") /> </cfif> <cfif dateCompare(application.tla.getLastUpdated(),dateAdd("h",-1,now())) eq -1 or url.reload> <cfset application.tla.setInventory() /> </cfif> <cfset tlaquery = application.tla.getInventoryAsQuery() />
If you wold like to use the CFC or pod, download the attachment to this post. Anyway, now I just need someone to post a legit ad :)
Download the attachment.
good on you.. the ads will come. TAL pays me about 10x what I make off of Google adsense.
Posted By mike / Posted on 05/02/2007 at 1:54 AM
Brian, I'm not seeing them?!
(do they blend in that well?) =)
Posted By
Sam / Posted on 05/02/2007 at 11:01 AM
Odd, they did offer CF code at one point. I have a copy I can send you if you like.
Posted By
Joshua / Posted on 05/02/2007 at 11:47 AM
Sam, There is a sponsored links to the left...this had only their test link for a bit, which is gone now. Like I said, I need some legit ads.
Joshua, The code that Todd sent me was based on their code (which he got from someone else who in turn got it from TLA). Anyway, I am told they *did* have CF support but pulled it for the moment and intend to put it back up. Either way, I think my version is pretty good :)
Posted By Brian Rinaldi / Posted on 05/02/2007 at 11:58 AM
Ok, so Sam's comment made me realize that showing the empty pod was worthless...so I have modified the code so that the pod only shows if there is an ad to show. I will update the zip attachment as well.
Posted By Brian Rinaldi / Posted on 05/02/2007 at 12:04 PM
They're probably still trying to figure out what your site is about so they know what ads to display. My google adsense network waaaay undersperformed last month... wondering if I should try out TLA.
Posted By
Sam / Posted on 05/02/2007 at 12:33 PM
When it comes to making money with the blog this site
http://www.johnchow.com/make-money-on-the-internet-april-2007/ really opened my eyes. Of course we wouldn't do all the things he does, and he has crazy traffic. Still if you look at where his money is coming from adsense is no where near the top. I am trying Kontera on my blog but find it more clutter than anything and will probably stop.
Posted By
Joshua / Posted on 05/02/2007 at 12:38 PM
Do you know if hiding the pod violates TLA's rules??
"You must keep our script installed for your site to remain in our marketplace."
Posted By
jeff / Posted on 05/04/2007 at 4:32 PM
I would doubt it since the script *is installed* it only hides the display if there are no entries.
Posted By Brian Rinaldi / Posted on 05/04/2007 at 5:31 PM
Brian, I just finished checking yours out. Pretty cool!
Basically the differences between ours is that your is a CFC, mine is a function. Your's caches to the application scope, mine caches to a file.
In any case, good job! It's interesting to see how others write applications that have similar functionality so I can compare my code.
If anyone else wants to check out mine you can go to
http://cftextadlinks.riaforge.org/
Posted By
TJ Downes / Posted on 05/05/2007 at 4:17 AM
Thanks Brian for the post about all of this. I signed up with TLA the other day and they just approved my site for ads and put it up for sale. Now I just hope they find someone that will pay $80 for an ad on my site... :)
Posted By
jeff / Posted on 05/09/2007 at 4:59 PM
That reminds me. The TAL site was down yesterday (I think it was yesterday) for a bit and the code sample I got from them had no error checking. Thus it brought down my whole blog. Took me a while to find out as well. I should really dump it and move to this handy pod. ;-)
Posted By
Joshua / Posted on 05/09/2007 at 5:08 PM
I getting long load times and even cfhttp time outs anyone else having that problem
Posted By
John Ramon / Posted on 07/20/2007 at 6:49 PM
John, I have since added a try/catch block around the cfhttp call to avoid errors when the site is down. You can also adjust the timeout of the cfhttp call within the tag to whatever is acceptable to you.
Posted By Brian Rinaldi / Posted on 07/21/2007 at 4:11 AM
Ah darn! I signed up with TLA and didn't get approved. Not enough traffic they said. 25k mo. visitors doesn't cut it, gotta work on that.
Posted By
Clint / Posted on 09/05/2007 at 7:27 AM
Clint,
I see no reason why they wouldn't accept you. You should double check there were no typos in the URL submited and or contact them. Many sites use TLA that have far less traffic and Page Rank.
Posted By
Joshua / Posted on 09/05/2007 at 7:31 AM
Wanted to note that the code should be updated with a try/catch block in case of TLA outages. I have had this code in place in my install, but I never updated the attachment. Here is a codeShare showing the updated function:
http://codeshare.ulatu.com/sep79f4e
Posted By Brian Rinaldi / Posted on 09/27/2007 at 7:44 AM