Technorati API Down?

June 15th, 2008

I have been working with a couple of web services lately (see prior post on Zend framework and Gdata), and upon deploying my application found out the technorati part of my site wasn’t working. I ran my unit tests, and multiple errors occured, saying the script wasn’t able to connect to the url:

Fatal error: Uncaught exception ‘Zend_Http_Client_Adapter_Exception’ with message ‘Unable to Connect to tcp://api.technorati.com:80. Error #110:
Connection timed out’

This happened last night, and again this morning. I tried to access the API straight through the browser (http://api.technorati.com/search?key=[apikey]&query=[words]), and the service is unavailable. So fairly sure it isn’t a result of the Zend Framework or my code. Can’t find any info on the web, so not sure what is going on… I’ll have to check in another day or two and see if it is back up or any other info is available.

Zend Framework and Youtube API

May 7th, 2008

I have been messing around with the different Zend_Service components available in the framework, and in general am very pleased with the ease of use and functionality. However, Zend_Gdata seems somewhat complicated. Now I must admit that I have not spent much time with classes, and I am sure the structure is set up to accommodate the large amount of services that Google provides, but there is very little documentation and the API doesn’t seem easily comprehensible, atleast compared to the Yahoo and Technorati APIs.

It appears that Google staff wrote the code, and I guess that is why it breaks with the naming convention - i.e. all the other Services fall under Zend_Services_***, while Google’s is Zend_Gdata. I am interested in the Youtube API, and it was easy to construct the query and get the result set back, but I found the result set to contain a lot of information (most of which was extraneous from my point of view), with many classes in it. Again, I was quickly trying to get it working and not at all interested in spending a lot of time learning the ins and outs of Google’s API’s. I am sure it will all click as I learn the other parts of Zend_Gdata, but for now, it is a pain.

For example, using the code from the documentation, when you grab a result set and iterate through it, how do you grab the src for the flash movie? Digging through the code, I found it was $videoEntry->mediaGroup->content[0]->getUrl(). That’s not to difficult, but then I noticed some of the results didn’t have any data for $videoEntry->mediaGroup->content. Is that a fluke, or by design? What do the values in the content object mean? I can guess what isDefault means and most of them are obvious, but the comments in the code are completely worthless (well not completely, as it does tell me that the channels property of the MediaContent object is a integer…). What’s the deal with the array of values - is the first value in the thumbnail array the preferable image, or just the first frame from the movie? I tried looking at the Google API docs, but that surprisingly didn’t seem to shed much light either.

I guess I should get off my ass, learn the API and contribute to the documentation. But its just so much easier to complain. Anyways, here is what I have quickly worked out. Once I start playing with the other Google services and have a better understanding of how all the classes fit together, I’ll let you know…


<?php
        $yt 
= new Zend_Gdata_YouTube();
$query $yt->newVideoQuery();
$query->videoQuery ‘cat’;
$query->startIndex 10;
$query->maxResults 20;
$query->orderBy ‘viewCount’;

echo $query->queryUrl “n”;
$videoFeed $yt->getVideoFeed($query); 

foreach ($videoFeed as $videoEntry) {
  echo 
“———VIDEO———-n”;
  echo 
“Title: ” $videoEntry->mediaGroup->title->text “n”;
  echo 
“Description:” $videoEntry->mediaGroup->description->text “n”;
  echo 
“Url to the Youtube page: ” $videoEntry->mediaGroup->player[0]->getUrl() . “n”;
  echo 
“Thumbnail image of the video: ” .  $videoEntry->mediaGroup->thumbnail[0]->getUrl() . “n”;
  if(!empty(
$videoEntry->mediaGroup->content[0])) {
      echo 
“Src to the video : ” $videoEntry->mediaGroup->content[0]->getUrl() . “n”;
  }
  echo 
“nnn”;
}

?>


Yahoo Opens Up

April 24th, 2008

An article talks about the opening up of Yahoo, both its embrace of open source and the company’s desire to open its platform to 3rd party developers. I have seen a lot of good things come out of Yahoo in the past couple of years, from Yahoo Site Explorer to Yahoo Pipes to Yahoo’s contributions to PHP, especially Unicode support in PHP 6.

The Search Monkey initiative looks very promising, and gives developers a lot of latitude in how they present their sites in the search results. Of course it will require individual users downloading your customizations, but for websites with dedicated users who also use Yahoo, I would think it would be fairly easy to get people to install your app.

I am interested to see what else Yahoo has up its sleeves. Sounds like the MS acquisition ballyhoo hasn’t stopped innovation at Yahoo; in fact, it may have done the opposite, as Yahoo sees the need to rapidly launch new products and increase the amount eyesballs and time spent on their site.

AdCenter Analytics

April 22nd, 2008

I finagled access to Microsoft’s AdCenter Analytics and spent an hour going through the UI and checking out the functionality. It contains the standard functionality found in free analytics package, with the ability to track marketing campaigns and report on revenue. You can set up goals in case reporting on revenue isn’t you thing, and AdCenter Analytics also supports setting up funnels to determine pain points in your site.

I had heard a year ago that Microsoft was including some slick new visualization tools in the offering. The app contains a tree view, which is a visualization of traffic stats and I found it mildly interesting, but probably not something I would use that often. It also offers a number of different graphs. For example, the visitors stats are represented by three different graphs, one in monthly increments, one if weekly increments and one in daily increments. You can click on the increment to limit the data to that specific date range. Again, this is something that is interesting, but not a feature that would make me want to sign up for the account.

The one interesting feature I encountered was the ability to automatically install the script on your site via a connection to your FTP server. I’m not sure how it works – does it open all your html files and insert the script in the bottom? I guess that would be useful for small sites.

There is a fairly intuitive tool to exclude query string parameters for dynamic urls and also exclude IP addresses. This seems easier but less flexible than Google Analytic’s filters. The IP address exclusion allows you to exclude C and B address blocks by using “*”, but it doesn’t support regular expressions, which is fine for most people. But that could become an issue if you needed to block a subset of IP addresses.

All in all it is a decent offering, but I didn’t see anything there that would make me want to switch or even sign up in addition to the current web analytics programs I use. As a new entrant to the field, I would have thought they would have some killer feature to gain traction. But that doesn’t appear to be the case.

Adcenter Pic
Adcenter Pic 2

Book Review : Zend Framework in Action

April 10th, 2008

I signed up for the Manning early access program for Zend Framework in Action to get information on the ACL functionality in the framework and the book provided some useful examples. I was a bit underwhelmed by the content in the first release, but I guess that is to be expected when viewing a rough cut.

This release (the 2nd) is a vast improvement, and the book is really starting to come together. I like how the authors go into detail about testing, showing not only how to test your models, but also how to test controllers, and showing some common set up steps. It doesn’t cover all the details of testing, nor should it, but the book provides a solid background to build upon. This is refreshing compared to most books which simply mention testing and say whole books have been written about it.

The book does a good job of logically building upon previous examples, and I felt the flow was good when introducing more complex topics like Plugins and ActionHelpers. This version was updated to include Zend_Layout, including info on partials and ActionStack plugin, but the chapter on forms is not complete yet – looking forward to reading that when it comes out.

I thought the AJAX chapter was a little shaky. Maybe it’s me, but I felt the authors spent too much time going over a general ajax request sans the framework. By the time they work the framework into the equation, they are using an include file in a controller action to bring in some procedural code written earlier. And that procedural code lives in the models folder – it just doesn’t seem right to me. I think this would have been a good opportunity to use Zend_Filter, although it is used in later in the book when discussing Zend_Search_Lucene (the chapter on this is very thorough and easy to understand). Also, they recommend using separate controllers/actions for Ajax requests and not rendering the view in each action method. That’s fine, but I would also like to have seen using a Plugin in the dispatch loop to detect an Ajax request and automatically turn off Zend_View/Zend_Layout.

I like how the authors occasionally work in design patters, such as the registry, and the observer pattern in the search chapter. The authors describe using the observer pattern with hooks in the DB class (hooks which I didn’t know existed) to update the search index.

The chapter on deployment was good; most books don’t seem to tackle this. My only quibble is when discussing setting up virtual hosts, they say to make sure to enable AllowOverride to use .htaccess. I don’t have any problem with this, but since the book is talking about Virtual Hosts, they should recommend putting the redirects in the httpd.conf file, rather than relying on .htaccess, as it is more efficient due to the fact that Apache doesn’t need to read a file on every request.

At times I felt like there may be too much ancillary topics covered, however, after finishing the book, I felt overall it was good that topics such as testing, deployment, and version control were covered. While there isn’t enough information to provide in depth coverage, it exposures the reader to these topics and provides enough information to get started, rather than just briefly mentioning it. And the coverage of the different components with the Zend Framework is comprehensive and understandable. If you are looking at working with the Zend Framework, I would definitely recommend this book.