--- activitystream_feed.module
+++ (clipboard)
@@ -7,12 +7,6 @@
  * This is required by lastfm, twitter, digg and delicious.
  */
 
-$path = drupal_get_path('module', 'activitystream_feed') .'/simplepie.inc';
-
-if (file_exists($path)) {
-  require_once $path;
-  }
-
 /**
  * Implementation of hook_requirements().
  */
@@ -23,8 +17,7 @@
   switch ($phase) {
     case 'install' :
     case 'runtime' :
-      $path = drupal_get_path('module', 'activitystream_feed') .'/simplepie.inc';
-      if (!file_exists($path)) {
+      if (!activitystream_feed_include_simplepie()) {
         $requirements['simplepie'] = array(
           'title' => $t("ActivityStream Feed: SimplePie Parser"),
           'description' => $t("Obtain the !simplepie package and copy simplepie.inc to the activitystream/activitystream_feed directory.",
@@ -34,7 +27,6 @@
         );
       }
       elseif ($phase == 'runtime') {
-        require_once($path);
         $requirements['simplepie'] = array(
           'title' => $t('ActivityStream Feed: SimplePie Parser'),
           'description' => t('The current installed version of SimplePie is !version',
@@ -47,6 +39,26 @@
   return $requirements;
 }
 
+function activitystream_feed_include_simplepie() {
+  if (module_exists('parser_simplepie')) {
+    if (!class_exists('SimplePie')) {
+      $path = drupal_get_path('module', 'parser_simplepie') .'/simplepie.inc';
+      if (file_exists($path)) {
+        require_once($path);
+        return TRUE;
+      }
+    }
+  }
+  else {
+    $path = drupal_get_path('module', 'activitystream_feed') .'/simplepie.inc';
+    if (file_exists($path)) {
+      require_once($path);
+      return TRUE;
+    }
+  }
+  return FALSE;
+}
+
 /*
  * The API passes in a $user object that contains four properties:
  * uid, userid, password, feed. These properties contain the account
@@ -58,31 +70,37 @@
   if (!$user->feed) {
     return;
   }
+  
+  if (activitystream_feed_include_simplepie()) {
+    $feed = new SimplePie();
+    $feed->set_cache_location(file_directory_temp());
+    $feed->set_feed_url($user->feed);
+    $feed->set_useragent('Drupal Activity Streams');  
+    if (!$feed->init()) {
+      watchdog('activitystream', $feed->error, NULL, WATCHDOG_ERROR);
+      return array();
+    }
 
-  $feed = new SimplePie();
-  $feed->set_cache_location(file_directory_temp());
-  $feed->set_feed_url($user->feed);
-  $feed->set_useragent('Drupal Activity Streams');  
-  if (!$feed->init()) {
-    watchdog('activitystream', $feed->error, NULL, WATCHDOG_ERROR);
-    return array();
-  }
-
-  $arrfeed = $feed->get_items();
-  $items = array();
-  if (is_array($arrfeed)) {
-    foreach ($arrfeed as $item) {
-      $activity['link'] = $item->get_permalink();
-      $activity['title'] = $item->get_title();
-      $activity['body'] = $item->get_description();
-      $activity['timestamp'] = strtotime(str_replace(',', '', $item->get_date()));
-      $activity['guid'] = md5($item->get_permalink());
-      $activity['data'] = serialize(array('favicon' => $feed->get_favicon(), 'feedtitle' => $feed->get_title()));
-      $items[] = $activity;
+    $arrfeed = $feed->get_items();
+    $items = array();
+    if (is_array($arrfeed)) {
+      foreach ($arrfeed as $item) {
+        $activity['link'] = $item->get_permalink();
+        $activity['title'] = $item->get_title();
+        $activity['body'] = $item->get_description();
+        $activity['timestamp'] = strtotime(str_replace(',', '', $item->get_date()));
+        $activity['guid'] = md5($item->get_permalink());
+        $activity['data'] = serialize(array('favicon' => $feed->get_favicon(), 'feedtitle' => $feed->get_title()));
+        $items[] = $activity;
+      }
     }
+
+    return $items;
+  }
+  else {
+    drupal_set_message(t("Obtain the !simplepie package and copy simplepie.inc to the activitystream/activitystream_feed directory.",
+    array('!simplepie' => l('SimplePie', 'http://simplepie.org/downloads', array(), NULL, NULL, TRUE))));
   }
-  
-  return $items;
 }
 
 /*
