CFLib.org – Common Function Library Project

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

Last updated September 14, 2005

author

Giampaolo Bellavite

Version: 1 | Requires: CF6 | Library: NetLib

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:

<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:

<!---
 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

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson