Zend Framework - Zend_Feed


Zend_Feed is used to consume RSS and Atom feeds. It is a simple yet powerful module in Zend Framework, to provide programmers a natural syntax for accessing elements of feeds, feed attributes, and entry attributes. Besides that it also has an extensive support to change feed and entry structure, and return new result back into XML, a recommended format to share structured data across different information systems, especially via the internet.

Now I will show you a simple code to access my very own feeds from my blog, since I am using Feedburner, my RSS feeds address will be at http://feeds.feedburner.com/radicalfix:

<?php
 
require_once 'Zend/Feed.php';
 
// a list of feeds you want to import 
$feeds = array ('http://feeds.feedburner.com/radicalfix');
 
foreach($feeds as $feed){
	// import feeds
	$channel = Zend_Feed::import($feed);
 
	$channelTitle =  $channel->title(); // the channel title 
	echo $channelTitle."\n\n"; // print the channel title
 
	/* for this example I will loop through the 
	 * requires RSS channel elements (title, link, decription)
	 * many optional elements are available please refer to 
	 * the latest RRS 2.0 Specification (http://cyber.law.harvard.edu/rss/rss.html) */ 
	foreach($channel->items as $item){
		$itemTitle = $item->title(); // the title of the feed
		$itemDesc = $item->description(); // the description of the feed
		$itemLink = $item->link(); // the link of the feed
 
		echo "\t".$itemTitle."\n\t".$itemDesc."\n\t".$itemLink."\n\n";
	}
}
 
?>

I will show you how to modify the RSS for the next few posts.

References:
RSS 2.0 specification: RSS 2.0

MySQL Question - Where are MySQL Databases Stored on Linux ?

I have a friend, who is a Linux newbie. He is forced to learn Linux, simply because his company is using it. His job title is MySQL Specialist. Today, he pop up a question from the instant messaging, ask me where are the MySQL databases stored on the Linux machine.

My answer is simple, It depends on how your MySQL database server is installed. If you are using Fedora Linux distribution, and you installed MySQL server during Fedora installation or RPM packages from MySQL, then probably your MySQL databases are store under /var/lib/mysql directory.

If a tar file binary distribution is installed by unpacking it at the installation location you choose (typically /usr/local/mysql), then the databases should be at data directory under your chosen directory.

If a source distribution is installed after you configure and compile it. By default, the installation step installs files under /usr/local, then databases should be store under subdirectory var.

What is b2rdf php ?

What is b2rdf php? Some of the PHP developers ask me.

It’s a file used in blogging applications to create an RSS feed. It is that simple!