[pLog-svn] r1070 - in plugins/trunk/feedreader/class: action xml

oscar at devel.plogworld.net oscar at devel.plogworld.net
Mon Feb 14 15:30:25 GMT 2005


Author: oscar
Date: 2005-02-14 15:30:24 +0000 (Mon, 14 Feb 2005)
New Revision: 1070

Removed:
   plugins/trunk/feedreader/class/xml/rss_parser/
   plugins/trunk/feedreader/class/xml/rsschannel.class.php
   plugins/trunk/feedreader/class/xml/rssitem.class.php
   plugins/trunk/feedreader/class/xml/rssparser.class.php
Modified:
   plugins/trunk/feedreader/class/action/readfeedaction.class.php
Log:
removed the rss parser (merged back into the core) and fixed a couple of includes


Modified: plugins/trunk/feedreader/class/action/readfeedaction.class.php
===================================================================
--- plugins/trunk/feedreader/class/action/readfeedaction.class.php	2005-02-14 15:24:39 UTC (rev 1069)
+++ plugins/trunk/feedreader/class/action/readfeedaction.class.php	2005-02-14 15:30:24 UTC (rev 1070)
@@ -2,7 +2,7 @@
 
 	include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
 	include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
-	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/xml/rssparser.class.php" );
+	include_once( PLOG_CLASS_PATH."class/xml/rssparser/rssparser.class.php" );
 	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/dao/feedreaderdata.class.php" );	
 	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/view/feedlistview.class.php" );		
 	include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );

Deleted: plugins/trunk/feedreader/class/xml/rsschannel.class.php
===================================================================
--- plugins/trunk/feedreader/class/xml/rsschannel.class.php	2005-02-14 15:24:39 UTC (rev 1069)
+++ plugins/trunk/feedreader/class/xml/rsschannel.class.php	2005-02-14 15:30:24 UTC (rev 1070)
@@ -1,79 +0,0 @@
-<?php
-
-	include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
-
-    /**
-     * <p>Provides information about an RSS channel, fetched from an RSS resource.</p>
-     * <p>This class provides methods to get the value of some of the attributes and possible child
-     * tags of the &lt;channel&lt; tag. In case we need to know about any other value that is not available
-     * via one of the 'getter' functions (getTitle(), getDescription(), getLink()), we can then get
-     * values from the resulting array as generated by the underlying RSS parser using the get() function.
-     * The array is an associative array where the keys are the name of the attribute/tag and the values are
-     * the value of the attribute/tag.</p>
-     */
-	class RSSChannel extends Object {
-
-		var $_title;
-		var $_description;
-		var $_link;
-		var $_channel;
-
-        /**
-         * Constructor.
-         *
-         * @param rssChannel An associative array which is the output of the MagpieRSS library
-         */
-		function RSSChannel( $rssChannel )
-		{
-			$this->_title = $rssChannel["title"];
-			$this->_description = $rssChannel["description"];
-			$this->_link = $rssChannel["link"];
-
-			$this->_channel = $rssChannel;
-		}
-
-        /**
-         * Returns the title of the channel
-         *
-         * @return Title of the channel
-         */
-		function getTitle()
-		{
-			return $this->_title;
-		}
-
-        /**
-         * Returns the description of the channel
-         *
-         * @return Description of the channel
-         */
-		function getDescription()
-		{
-			return $this->_description;
-		}
-
-        /**
-         * Returns the link of the channel
-         *
-         * @return The link of the channel
-         */
-		function getLink()
-		{
-			return $this->_link;
-		}
-
-        /**
-         * Gets another property of the channel. The methods shown so far give easier access
-         * to some of the methods more commonly used, but the MagpieRSS will include anything else
-         * in the output array, so access is given to this method. We only need to know the name
-         * of the parameter.
-         *
-         * @param key The name of the parameter
-         * @return The value assigned to that parameter
-         */
-		function get( $key )
-		{
-			return $this->_channel[$key];
-		}
-	}
-?>

Deleted: plugins/trunk/feedreader/class/xml/rssitem.class.php
===================================================================
--- plugins/trunk/feedreader/class/xml/rssitem.class.php	2005-02-14 15:24:39 UTC (rev 1069)
+++ plugins/trunk/feedreader/class/xml/rssitem.class.php	2005-02-14 15:30:24 UTC (rev 1070)
@@ -1,100 +0,0 @@
-<?php
-
-	include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
-
-    /**
-     * <p>Provides information about an RSS item, fetched from an RSS resource.</p>
-     * <p>This class provides methods to get the value of some of the attributes and possible child
-     * tags of the &lt;item&lt; tag. In case we need to know about any other value that is not available
-     * via one of the 'getter' functions (getTitle(), getImage(), getDescription(), getLink()), we can then get
-     * values from the resulting array as generated by the underlying RSS parser using the get() function.
-     * The array is an associative array where the keys are the name of the attribute/tag and the values are
-     * the value of the attribute/tag.</p>
-     */
-	class RSSItem extends Object {
-
-		var $_link;
-		var $_title;
-		var $_image;
-		var $_description;
-		var $_item;
-
-        /**
-         * Creates an RSSItem object from the output given by the MagpieRSS parser
-         *
-         * @param item The RSS item.
-         */
-		function RSSItem( $item )
-		{
-			$this->_link = $item["link"];
-			$this->_title = $item["title"];
-			$this->_image = $item["image"];
-			$this->_description = $item["description"];
-
-			// also keep the item just in case
-			$this->_item = $item;
-		}
-
-        /**
-         * Returns the link assigned to the item.
-         *
-         * @return The link assigned to the item.
-         */
-		function getLink()
-		{
-			return $this->_link;
-		}
-
-        /**
-         * Returns the title assigned to the link.
-         *
-         * @return Title assigned to the link.
-         */
-		function getTitle()
-		{
-			return $this->_title;
-		}
-
-        /**
-         * Image assigned to the item
-         *
-         * @return URI of the image assigned to this item
-         */
-		function getImage()
-		{
-			return $this->_image;
-		}
-
-        /**
-         * Description assigned to this item.
-         *
-         * @param Description assigned to the item.
-         */
-		function getDescription()
-		{
-			return $this->_description;
-		}
-
-		/**
-		 * Even though we provide convenience methods for the most used fields of the
-		 * object, might be good to provide one to access the 'item' array generically
-         *
-         * @param key Name assigned to the item
-         * @return The value of the item.
-		 */
-		function get( $key )
-		{
-			return $this->_item[$key];
-		}
-		
-		/**
-		 * returns a unique id for this item
-		 *
-		 * @return a unique id
-		 */
-		function getUniqueId()
-		{
-			return( md5( $this->getLink().$this->getTitle().$this->getDescription()));
-		}
-	}
-?>

Deleted: plugins/trunk/feedreader/class/xml/rssparser.class.php
===================================================================
--- plugins/trunk/feedreader/class/xml/rssparser.class.php	2005-02-14 15:24:39 UTC (rev 1069)
+++ plugins/trunk/feedreader/class/xml/rssparser.class.php	2005-02-14 15:30:24 UTC (rev 1070)
@@ -1,96 +0,0 @@
-<?php
-
-	include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
-	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/xml/rss_parser/rss_cache.inc" );
-	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/xml/rss_parser/rss_parse.inc" );
-	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/xml/rss_parser/rss_fetch.inc" );
-	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/xml/rss_parser/rss_utils.inc" );
-	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/xml/rsschannel.class.php" );
-	include_once( PLOG_CLASS_PATH."plugins/feedreader/class/xml/rssitem.class.php" );
-
-    /**
-     * <p>This parser is a wrapper around the functionality provided by the MagpieRSS parser, which
-     * can be found at http://magpierss.sourceforge.net/. The RSS parser is compatible with
-     * RSS 0.9, 1.0 and almost all the modules of the 1.0 specification.</p>
-     * <p>This object is exported to all templates so that we can easily incorporate the headlines
-     * and/or the content of other pages in our journal. To do so, this object is exported with
-     * "rss" as its identifier, so a simple operation to fetch the headlines from Slashdot would
-     * look like:</p>
-     * <pre>
-     * {if $rss->parse("http://slashdot.org/slashdot.rdf")}
-     *  {foreach from=$rss->getItems() item=rssItem}
-     *    &lt;a href="{$rssItem->getLink()}"&gt;{$rssItem->getTitle()}&lt;/a&gt;&lt;br/&gt;
-     *  {/foreach}
-     * {/if}
-     * </pre>
-     * <p>The parse() method takes a url as a parameter, and it will return true if the url
-     * was correctly fetched. If so, we can then ask the parser to gives us an array of
-     * RSSItem objects which contain information about all the different &lt;item&gt; tags that were
-     * found in the RSS feed. So, the only thing we have to do now is iterate through the array using
-     * Smarty's <i>{foreach ...}</i> construction and call the appropiate methods on the RSSItem object.</p>
-     * <p>To get more information about the channel (whatever was found between the &lt;channel&gt; opening
-     * and closing tag) we can call the getChannel() function and we will get a nice and ready RSSChannel
-     * information that we need to know.</p>
-     * <p>If the RSS parser has been disabled via the configuration file, then the constructor will not do
-     * anything and the parse method will return false.</p>
-     */
-	class RSSParser extends Object {
-
-		var $_items;
-		var $_channel;
-
-        /***
-         * The constructor checks if the RSS parser is enabled in the configuration file. If it is
-         * not, it simply quits.
-         */
-		function RSSParser()
-		{
-			$this->_channel = "";
-		}
-
-        /**
-         * Parses an RSS feed
-         *
-         * @param rssFeed The URL of the RSS feed.
-         * @return Returns true if the parsing was successful.
-         */
-		function parse( $rssFeed )
-		{
-			$rss = fetch_rss( $rssFeed );
-
-			if( !$rss )
-				return false;
-
-			$this->_channel = new RSSChannel( $rss->channel );
-
-			$this->_items = Array();
-			foreach ($rss->items as $item ) {
-				$itemObject = new RSSItem( $item );
-				array_push( $this->_items, $itemObject );
-			}
-
-			return true;
-		}
-
-        /**
-         * Returns the items obtained from parsing the last RSS source specified
-         *
-         * @return An array of RSSItem objects
-         */
-		function getItems()
-		{
-			return $this->_items;
-		}
-
-        /**
-         * Returns information about the channel parsed.
-         *
-         * @return An RSSChannel object containing information about the last RSS
-         * source parsed.
-         */
-		function getChannel()
-		{
-			return $this->_channel;
-		}
-	}
-?>




More information about the pLog-svn mailing list