I have gone ahead and added ping support to BlogCFC for
IceRocket.com. For those who have never used (or heard of) their site, it's funded by
Mark Cuban and it does a great job of searching blogs. I call it the "Google of blog searching," as I tend to find their results a bit more on target than the other engines. I will be sending the code to Ray for consideration for the next release of BlogCFC, but if you want it now, here's what you need:
1) The new pingIceRocket() method:
<!---
This function written by Dave Carabetta, www.cbetta.com/blog/
---> <cffunction name="pingIceRocket" output="true" returnType="boolean" access="public"
hint="Ping IceRocket.com to add blog to IceRocket high-priority indexing queue"> <cfset var pingData = "" /> <cfset var pingDataLen = "" /> <cfset var isOK = false /> <cfset var iceRocketResponse = "" /> <cfset var pingResultString = "" /> <cfoutput> <cfsavecontent variable="pingData"> <?xml version=
"1.0" encoding=
"utf-8"?>
<methodCall> <methodName>ping
</methodName> <params> <param> <value> <string>#instance.blogURL#
</string> </value> </param> </params> </methodCall> </cfsavecontent> </cfoutput> <cfset pingData = trim(pingData) /> <cfset pingDataLen = len(pingData) /> <cfhttp method="post" url="http://rpc.icerocket.com/" port="10080" timeout="20" throwonerror="false"> <cfhttpparam type="HEADER" name="User_Agent" value="BlogCFC" /> <cfhttpparam type="HEADER" name="Host" value="#cgi.http_host#" /> <cfhttpparam type="HEADER" name="Content-Type" value="text/xml" /> <cfhttpparam type="HEADER" name="Content-Length" value="#pingDataLen#" /> <cfhttpparam type="XML" value="#pingData#" /> </cfhttp> <!--- Create an XML object using the RPC result string ---> <cfset iceRocketResponse = xmlParse(cfhttp.fileContent) /> <!--- Set the response string to a local variable for cleaner access ---> <cfset pingResultString = iceRocketResponse.methodResponse.params.param.value.string.xmlText /> <!--- Check the status code and the XML packet's method response to make sure things worked ---> <cfif not compare(cfhttp.statuscode, "200 OK") and not compare(pingResultString, "Thanks for ping")> <cfset isOK = true /> </cfif> <cfreturn isOK /> </cffunction>
2) Tweak the pingAggregators() method to look for the @icerocket directive:
<cfif aURL is "@technorati">
<cfset pingTechnorati()>
<cfelseif aURL is "@weblogs">
<cfset pingweblogs()>
<cfelseif aURL is "@icerocket">
<cfset pingIceRocket()>
<cfelse>
<cfhttp url="#aURL#" method="GET" resolveurl="false">
</cfif>
3) Add @icerocket to the pingurls line in the blog.ini file.
Refresh the application scope and you'll be good to go.
Blake
I never heard of icerocket, but I'll start using it now.
-Rob
Did you send your mod over to Ray? He's pretty good about folding cool mods into the core in future releases.