summaryrefslogtreecommitdiffstats
path: root/common/app/classes/PlanetFeed.php
diff options
context:
space:
mode:
Diffstat (limited to 'common/app/classes/PlanetFeed.php')
-rw-r--r--common/app/classes/PlanetFeed.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/common/app/classes/PlanetFeed.php b/common/app/classes/PlanetFeed.php
new file mode 100644
index 0000000..a6c7aab
--- /dev/null
+++ b/common/app/classes/PlanetFeed.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * Planet person
+ */
+
+class PlanetFeed extends SimplePie
+{
+ public $name;
+ public $feed;
+ public $website;
+
+ public function __construct($name, $feed, $website)
+ {
+ $this->name = $name;
+ $this->feed = $feed;
+ $this->website = $website;
+ parent::__construct();
+ $this->set_item_class('PlanetItem');
+ $this->set_cache_location(dirname(__FILE__).'/../../cache');
+ $this->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE);
+ $this->set_feed_url($this->getFeed());
+ $this->set_timeout(5);
+ $this->set_stupidly_fast(true);
+ }
+
+ public function getFeed()
+ {
+ return $this->feed;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function getWebsite()
+ {
+ return $this->website;
+ }
+
+ public function compare($person1, $person2)
+ {
+ return strcasecmp($person1->name, $person2->name);
+ }
+}