Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.trackback.threadScript
on threadScript (adrpost, adrblog=radio.weblog.init ()) {
<<Changes
<<8/21/03; 6:05:30 PM by JES
<<Perform autodiscovery and pings in a try block to prevent error windows from popping up when a server times out or refuses a connection.
<<8/5/03; 12:16:57 PM by JES
<<Fixed a bug which could cause multiple TrackBack pings to be sent under certain circumstances.
<<7/21/03; 1:42:49 AM by JES
<<Created.
if adrblog^.prefs.trackback.flEnabled {
bundle { //if another thread is already handling this post, exit
if not defined (system.temp.radio.misc.trackbackThreads) {
new (tableType, @system.temp.radio.misc.trackbackThreads)};
if defined (system.temp.radio.misc.trackbackThreads.[nameOf (adrpost^)]) {
return};
system.temp.radio.misc.trackbackThreads.[nameOf (adrpost^)] = true};
if defined (adrpost^.link) {
if sizeOf (adrpost^.link) > 0 {
if not (string.lower (adrpost^.link) == "http://") {
trackback.initOutboundUrl (adrpost, adrpost^.link)}}};
try { //prevent error windows from popping up when autodiscovery fails
trackback.changedPost (adrpost, false, string (adrpost^.text));
local (adrurl);
for adrurl in @adrpost^.trackback.outbound.urls {
if (not adrurl^.flpinged) and adrurl^.flSupportsTrackback {
try {
radio.trackback.ping (adrblog, adrpost, adrurl)}
else {
adrurl^.errorstring = tryerror};
adrurl^.flpinged = true}}};
if defined (system.temp.radio.misc.trackbackThreads.[nameOf (adrpost^)]) {
delete (@system.temp.radio.misc.trackbackThreads.[nameOf (adrpost^)])}};
return}
<<bundle //test code
<<local (adrblog = radio.weblog.init ())
<<local (adrpost = @adrblog^.posts[sizeOf (weblogData.posts)])
<<threadScript (adrpost, adrblog)
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.