CFLib.org – Common Function Library Project

pingTrackBackURL(trackbackurl, permalink [, charset] [, title] [, excerpt] [, blogName] [, timeout])

Last updated September 14, 2005

Version: 1 | Requires: ColdFusion MX | Library: NetLib

 
Rated 0 time(s). Average Rating: 0

Description:
Pings a TrackBack URL according to the TrackBack Specification from SixApart (http://www.sixapart.com/pronet/docs/trackback_spec).

Return Values:
Returns a string.

Example:

view plain print about
<cfset trackBackUrl = "http://www.bellavite.com/blog/_ping.cfm?blogID=1482">
<cfset permLink = "http://www.cflib.org">
<cfset charset = "utf-8">
<cfset title = "Just a test">
<cfset excerpt = "Let we see how this UDF works">
<cfset blogName = "The CFLib Project">

<cfset ret = pingTrackBack(trackBackUrl, permLink, charset, title, excerpt, blogName)>
<cfoutput>#ret#</cfoutput>

Parameters:

Name Description Required
trackbackurl The TrackBack ping URL to ping Yes
permalink The permalink for the entry Yes
charset Default to utf-8. No
title The title of the entry No
excerpt An excerpt of the entry No
blogName The name of the weblog to which the entry was posted No
timeout Default to 30. Value, in seconds, that is the maximum time the request can take No

Full UDF Source:

view plain print about
<!---
 Pings a TrackBack URL.
 
 @param trackbackurl      The TrackBack ping URL to ping (Required)
 @param permalink      The permalink for the entry (Required)
 @param charset      Default to utf-8. (Optional)
 @param title      The title of the entry (Optional)
 @param excerpt      An excerpt of the entry (Optional)
 @param blogName      The name of the weblog to which the entry was posted (Optional)
 @param timeout      Default to 30. Value, in seconds, that is the maximum time the request can take (Optional)
 @return Returns a string. 
 @author Giampaolo Bellavite (giampaolo@bellavite.com) 
 @version 1, January 12, 2006 
--->

<cffunction name="pingTrackback" output="false" returntype="string">
    <cfargument name="trackBackURL" type="string" required="yes">
    <cfargument name="permalink" type="string" required="yes">
    <cfargument name="charset" type="string" required="no" default="utf-8">
    <cfargument name="title" type="string" required="no">
    <cfargument name="excerpt" type="string" required="no">
    <cfargument name="blogName"  type="string" required="no">
    <cfargument name="timeout"  type="numeric" required="no" default="30">
    <cfset var cfhttp = "">
    <cfhttp url="#arguments.trackBackURL#" method="post" timeout="#arguments.timeout#" charset="#arguments.charset#">
        <cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded; charset=#arguments.charset#">
        <cfhttpparam type="formfield" encoded="yes" name="url" value="#arguments.permalink#">
        <cfif structKeyExists(arguments, "title")>
            <cfhttpparam type="formfield" encoded="yes" name="title" value="#arguments.title#">
        </cfif>
        <cfif structKeyExists(arguments, "excerpt")>
            <cfhttpparam type="formfield" encoded="yes" name="excerpt" value="#arguments.excerpt#">
        </cfif>
        <cfif structKeyExists(arguments, "blogName")>
            <cfhttpparam type="formfield" encoded="yes" name="blog_name" value="#arguments.blogName#">
        </cfif>
    </cfhttp>
    <cfreturn cfhttp.FileContent>
</cffunction>
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Adam Cameron Adam Cameron added
composeDateTime
21 day(s) ago

Chris Weller Chris Weller added
convertQueryStri...
a while ago

Greg Nettles Greg Nettles added
arrayDiff
a while ago

Nathan Dintenfass Nathan Dintenfass added
ArrayOfStructsSo...
a while ago

Top Rated

Darwan Leonardo Sitepu backupDatabase
Rated 5.0, 36 time(s)

Barney Boisvert indentXml
Rated 5.0, 10 time(s)

Rachel Lehman deAccent
Rated 5.0, 6 time(s)

Isaac Dealey                                      countArbitraryDa...
Rated 5.0, 5 time(s)

Created by Raymond Camden / Design by Justin Johnson