--- freelinking.module.orig	2009-09-15 15:15:33.000000000 -0500
+++ freelinking.module	2009-09-15 17:23:33.000000000 -0500
@@ -8,6 +8,25 @@ function _freelinking_include_all_plugin
   } // endforeach looping through plugins
 } // endfunction _freelinking_include_all_plugins
 
+
+function freelinking_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
+  switch($op) {
+    case 'view':
+      if ($node->type == variable_get('freelinking_node_scan', 'story')) {
+        if (strpos($node->body, 'freelink notfound') !== False) {
+          // get raw body from DB
+          $rbody = db_fetch_array(db_query('SELECT r.body FROM {node_revisions} r WHERE r.nid = %d ORDER BY r.timestamp DESC', $node->nid));
+          // find any cached entries
+          $cache_entries = db_fetch_array(db_query('SELECT cid FROM {cache_filter} c WHERE c.cid LIKE "%s"', "%:" . md5($rbody['body'])));
+          // now clear them out
+          foreach ($cache_entries as $cid) {
+            cache_clear_all($cid, 'cache_filter');
+          }
+        } //endif strpos searching for not found freelink
+      } //endif node type check
+  } // endswitch $op
+} // endfunction freelinking_nodeapi
+
 function freelinking_filter($op, $delta = 0, $format = -1, $text = '', $langcode = '', $cache_id = 0) {
   global $freelinking;
   switch ($op) {
@@ -100,6 +119,14 @@ function freelinking_settings() {
     } // endif plugin has a settings function
   } // endforeach looping through plugins
 
+  $form['freelinking_node_scan'] = array(
+    '#title' => t('Node type to scan'),
+    '#type'  => 'select',
+    '#options' => node_get_types('names'),
+    '#default_value' => variable_get('freelinking_node_scan', 'story'),
+    '#description'  => t('Scan this node type for updated freelinks.'),
+  );
+
   $form['freelinking_default'] = array(
     '#title' => t('Plugin to use when not indicated in the freelink'),
     '#type'  => 'select',
