Monday, November 17, 2008

New Site Launched - St. Mary's

The St. Mary's Catholic Church website was a volunteer project that I did. Serving the greater Mid South with it's numerous ministries I wanted to give them a professional web presence. The site utilizes the Zend Framework to access Google services as well as custom helper classes that I wrote to simply rendering.

Enjoy.

http://www.stmary-memphis.com/

Friday, September 5, 2008

Design Overhaul

I finally got a chance to redesign www.randomthoughtprocess.com.  The old design had been sitting out there for 5 years.  I minimalised the design, made it pure CSS and got rid of content that wasn't be accessed.  The main purpose of the site is to showcase more abstract work.

I also converted www.mckinna-wiles.com over from information and media about my wife and I to a site dedicated to our daughter McKinna Wiles.

Monday, August 25, 2008

Label Me

Of the API features that Google offers for their Blogger service the one that I was most surprised to see missing is a method to retrieve all the tags(category) for a blog. Though listed in their query parameters is the syntax for search by tag/category, the "cloud" was missing. The below code takes care of this missing feature.

::NOTE::
This class will be rolled into my helper classes soon.

class CW_Blog_Util {
const BLOGGER_URL = 'http://www.blogger.com/feeds/blogId/posts/default';

/**
* associative array holding blog tbl properties
*
* @var array
*/
private $_blogs = array();

/**
* blog title
*
* @var string
*/
private $_title = "";

private $_gDataQuery = null;

private $_gQuery = null;

public function __construct() {
$this->_gQuery = new Zend_Gdata();
}

public function getAllEntries() {

$query = $this->_getGdataQuery();
$feed = $this->_gQuery->getFeed($query);

return $feed;
}

public function getLatestBlog() {

$query = $this->_getGdataQuery();
$feed = $this->_gQuery->getFeed($query);

return $feed->current();
}

public function getBlogListByTag($tag) {

$query = $this->_getGdataQuery();
$query->setCategory($tag);

$feed = $this->_gQuery->getFeed($query);

return $feed;
}

public function getBlogLabels() {

$labels = array();

foreach ($this->getAllEntries() as $attr) {

for ($i = 0; $i < count($attr->category); $i++) {
$labels[] = $attr->category[$i]->term;
}
}

return array_count_values($labels);
}

private function _getGdataQuery() {
$this->_gDataQuery = new Zend_Gdata_Query(self::BLOGGER_URL);

return $this->_gDataQuery;
}

}

// Usage
$blogs = new CW_Blog_Util();

foreach ($blogs->getBlogLabels() as $label => $count) {
print "Label {$label}
";
}

Tuesday, August 19, 2008

McKinna Wiles is Reborn

In anticapation for my daughter, McKinna Wiles, birth I have revamped http://www.mckinna-wiles.com/ using Wordpress as the CMS and a modified theme from wpzone.net.

Enjoy

Monday, August 4, 2008

Access XML Nodes From Namespaces With Zend Framework

One of the requirements for a project that I am working on is that a "weather" module display on on of the main pages.  At first glance this should be pretty easy.  While working on it I noticed that I wanted to access more of the information that the feed had available.  I found plenty of tutorials on how to access the node values using SimpleXML, but I couldn't find what I was looking for utilizing Zend Framework.

After a quick response from the mailing list and references to the PHP online manual I came up with the solution.

Thanks to Pádraic Brady for the assistance.


Zend_Feed::registerNamespace('yweather','http://xml.weather.yahoo.com/ns/rss/1.0');
Zend_Feed::registerNamespace('geo','http://www.w3.org/2003/01/geo/wgs84_pos#');

$feed = Zend_Feed::import("http://weather.yahooapis.com/forecastrss?p=38105");

// Conditional Codes: http://developer.yahoo.com/weather/#codes
$condition = $feed->current()->{'yweather:condition'};
$text      = $condition->getDOM()->getAttribute('text');
print "Text {$text}
";

$astronomy = $feed->{'yweather:astronomy'};
$text      = $astronomy->getDOM()->getAttribute('sunrise');
print "Sunrise Attribute {$text}
";
          
$lat  = $feed->current()->{'geo:lat'};
$text = $lat->getDOM()->nodeValue;
print "Latitude {$text}
";

Friday, July 25, 2008

Come Out, Come Out Where Ever You Are

I made an update to the helper classes and comitted them to the changes in subversion and download version.  If a photo has been tagged with a location then the GeoWhere node is returned as a property.

Monday, June 30, 2008

Mi Picasa Framework, es su Picasa Framework

One of the best features that the Zend Framework offers is it's interface utilities to many of Google's webservices. Namely Picasa and YouTube. However, in my ever continuing effort to simplify my development tasks I started writing some helper classes that would make it more intuitive to retrieve some basic information. For example, give me all the Picasa galleries for the user kwylez or give me the first 15 YouTube videos in the entertainment category.

While this task is fairly easy with the ZF APIs the method names aren't always intuitive. This is where my little project began, as most do. Having a task that one would like to accomplish easily.
I have committed the first version of the helper class framework to subversion as well as a file download.

When prompted for a username/password when checking out of subversion the username is anonymous and password is empty.

The zip file/repository includes:
  1. Custom helper classes
  2. Usage examples

Class features:

  1. Zend Framework style directory structure for easy autoloading
  2. Picasa interface that retrieves meta information on author, galleries, and images
  3. YouTube interface that retrieves information based upon a user or category

Dependencies

  1. Zend Framework 1.5