? georss_country_problem.patch
? georss_feedapi_basics.patch
? georss_feedparser.patch
? georss_location_saving.patch
Index: georss.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/georss/georss.module,v
retrieving revision 1.2.2.2
diff -u -p -r1.2.2.2 georss.module
--- georss.module	22 Jan 2007 19:22:20 -0000	1.2.2.2
+++ georss.module	14 Feb 2007 16:54:43 -0000
@@ -98,13 +98,17 @@ function georss_nodeapi(&$node, $op, $te
     case 'insert':
     case 'update':
       if (variable_get('georss_incoming_enabled', TRUE)) {
-        if(isset($node->rss_item_data)) { // aggregator2 module feeds
+        if (isset($node->feedparser_item_data)) { // feedparser module feeds
+          $point_coordinates = georss_extract($node->feedparser_item_data, 'feedparser', 'point');
+        }
+        if (isset($node->rss_item_data)) { // aggregator2 module feeds
           $point_coordinates = georss_extract($node->rss_item_data, 'aggregator2', 'point');
         }
         if ($point_coordinates['latitude'] && $point_coordinates['longitude']) {
-          $node->location['latitude'] = $point_coordinates['latitude'];
-          $node->location['longitude'] = $point_coordinates['longitude'];
-          $node->location['source'] = 3;  // LOCATION_LATLON_GEOCODED_EXACT from location.module
+          $node->locations[0]['latitude'] = $point_coordinates['latitude'];
+          $node->locations[0]['longitude'] = $point_coordinates['longitude'];
+          $node->locations[0]['country'] = 'xx';  // hack to get location.module to save info, see http://drupal.org/node/109611
+          $node->locations[0]['source'] = 3;  // LOCATION_LATLON_GEOCODED_EXACT from location.module
         }
       }
       break;
@@ -155,6 +159,9 @@ function georss_extract($data = array(),
           if ($data['GEO:LONG'][0]['VALUE']) { // W3C basic geo vocabulary
             $longitude = $data['GEO:LONG'][0]['VALUE'];
           }
+          if ($data['GEO:LON'][0]['VALUE']) { // W3C basic geo vocabulary, common misuse of spec
+            $longitude = $data['GEO:LON'][0]['VALUE'];
+          }
           if ($data['GEORSS:POINT'][0]['VALUE']) { // GeoRSS Simple
             list($latitude, $longitude) = split(' ',trim($data['GEORSS:POINT'][0]['VALUE']));
           }
@@ -162,6 +169,13 @@ function georss_extract($data = array(),
             list($latitude, $longitude) = split(' ',trim($data['GEORSS:WHERE'][0]['GML:POINT'][0]['GML:POS'][0]['VALUE']));
           }
           return array('latitude' => check_plain($latitude), 'longitude' => check_plain($longitude));
+          break;
+        case 'feedparser':
+          $item = (object)$data;
+          $latitude = $item->get_latitude();
+          $longitude = $item->get_longitude();
+          return array('latitude' => check_plain($latitude), 'longitude' => check_plain($longitude));
+          break;
       }
     case 'line':
     case 'polygon':
