Index: leech.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/leech/leech.module,v
retrieving revision 1.4.2.38
diff -u -r1.4.2.38 leech.module
--- leech.module	24 Sep 2007 12:48:09 -0000	1.4.2.38
+++ leech.module	8 Oct 2007 12:37:32 -0000
@@ -2233,7 +2233,9 @@
   $duplicate_count = 0;
   $items_added = 0;
   $unique_links = $node->leech->connection->news_feed->has_unique_links;
+  $item_index = -1;
   foreach ($node->leech->connection->news_feed->items as $item) {
+    $item_index++;
     if (!$item->guid && $node->leech_news->items_guid) {
       $item->guid = md5("$item->title - $item->body");
     }
@@ -2354,6 +2356,7 @@
     
     // Temporary properties
     $edit->leech_news_item->feed_data = &$node->leech->connection->news_feed;
+    $edit->leech_news_item->item_index = $item_index;
     // Postprocess the node. Here you can modify externally the node before save
     node_invoke_nodeapi($edit, 'leech_news_presave');
     if ($errors = node_template_save($edit)) {
Index: leech_feed_taxonomy/leech_feed_taxonomy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/leech/leech_feed_taxonomy/Attic/leech_feed_taxonomy.module,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 leech_feed_taxonomy.module
--- leech_feed_taxonomy/leech_feed_taxonomy.module	11 Sep 2007 18:47:19 -0000	1.1.2.5
+++ leech_feed_taxonomy/leech_feed_taxonomy.module	8 Oct 2007 12:46:59 -0000
@@ -96,15 +96,22 @@
       // the structure here to access the parsed "raw" xml
       // $node->leech_news_item->feed_data->channel->ITEM[n]
       // Search for the proper n
-      $num_of_items = count($node->leech_news_item->feed_data->items);
-      for ($i = 0; $i < $num_of_items; $i++) {
-        if ($node->leech_news_item->feed_data->items[$i]->body == $node->body
-            && $node->leech_news_item->feed_data->items[$i]->title == $node->title) {
-          $which = $i;
-          break;
+      if (isset($node->leech_news_item->item_index)) 
+      {
+        $which = $node->leech_news_item->item_index;
+      }
+      else
+      {
+        $num_of_items = count($node->leech_news_item->feed_data->items);
+        for ($i = 0; $i < $num_of_items; $i++) {
+          if ($node->leech_news_item->feed_data->items[$i]->body == $node->body
+              && $node->leech_news_item->feed_data->items[$i]->title == $node->title) {
+            $which = $i;
+            break;
+          }
         }
       }
-      $item_data = $node->leech_news_item->feed_data->channel['ITEM'][$which];
+      $item_data = $node->leech_news_item->feed_data->root['ENTRY'][$which];
       // Solution of douggreen (http://drupal.org/user/29191) Thanks!
       //[RSS:CATEGORY][][VALUE] && [RSS:CATEGORY][][DOMAIN] attrib
       //[ATOM:CATEGORY][][TERM][][VALUE]
@@ -112,10 +119,10 @@
       if ($item_data['CATEGORY'][0]['VALUE']) {
         $categories = $item_data['CATEGORY']; // RSS 0.92, 2.0
       }
-      else if ($item_data['CATEGORY'][0]['TERM'][0]['VALUE']) {
+      else if ($item_data['CATEGORY'][0]['TERM']) {
         $categories = $item_data['CATEGORY']; // ATOM 1.0
       }
-      else if ($item_data['ATOM:CATEGORY'][0]['TERM'][0]['VALUE']) {
+      else if ($item_data['ATOM:CATEGORY'][0]['TERM']) {
         $categories = $item_data['ATOM:CATEGORY']; // ATOM 1.0
       }
       else if ($node->rss_item_data['SUBJECT']) {
@@ -169,4 +176,4 @@
    return $items;
 }
 
-?>
\ No newline at end of file
+?>
