Since
MXNA is aggregating my feed now, I needed to have BlogCFM notify MXNA when a new post was done.
Previously , I showed how to add your own configuration options to BlogCFM. This time I added a PING_ON_UPDATE configuration option, along with adding the field to the admin screen.
My SendPings function is very simple but could use some work for error checking and stuff. Perhaps I will work in some error checking later but since it is only me using this function currently, I know I will type in the correct ping URLs.
I added the following to the BlogCFM.cfc but could be used in any blog really. It accepts one argument, a list of URLs to send to seperated by ";"
<cffunction name="SendPings" access="public" output="false" returntype="void">
<cfargument name="UrlLIST" type="string" required="yes" hint="A list of URLs seperated by ;">
<cfloop from="1" to="#listlen(arguments.UrlList,";")#" index="listindex">
<cfhttp url="#listgetat(arguments.UrlList,listindex,";")#" throwonerror="no"></cfhttp>
</cfloop>
</cffunction>
Next was to tell BlogCFM to send the pings.
I put the following below the notifications area of SaveEntry()
<cfif getBlogConfigValue(arguments.blog_id, "PING_ON_UPDATE") NEQ "">
<cfset SendPings(getBlogConfigValue(arguments.blog_id, "PING_ON_UPDATE"))>
</cfif>
That did it! Now BlogCFM will ping whatever URLs I type into the admin screen (MXNA).