A Look Back, A Look Ahead

Back in March I wrote about what I planned to focus on once the Horde 4 release process was complete. Well, here we are 9 months later and my personal roadmap has gotten a bit clouded in my head. So I thought with this being the end of the year, it is a good time to take stock and organize what I plan to focus on in the months ahead.

It's always nice to look back and see how well one stuck to plan, and to also take a minute to enjoy one's accomplishments. While there are still things left outstanding on that list, given how little time I have had lately to contribute, I am happy with what I managed to complete.

The work on Ansel that was necessary for a Horde 4 release, including a complete rewrite of the geotagging support, was completed. This has lead to lots of improvements in Horde's mapping library.  I also pushed out an alpha release of iPhoto and Aperture export plugins. These can be downloaded from Ansel's download page. It felt really good to get those things finally off my todo list and out the door. There are lots of enhancement requests

The Hermes Ajax interface, while not feature complete, is functional for day to day time entry. The main missing piece is the search/report functionality, and I hope to complete that in the next few months. Unfortunately, the mobile interface for Hermes has not yet been started. I'll hopefully get to it one of these days, but there seems to always be something else that has more importance for me. It likely won't be finished by the time Hermes for Horde 4 is released.

We had our annual Hackathon this past November in Boston, and LOTS of great work was done by all of our team memebers. Personally - in addition to eating Lucky Burgers and attempting to juggle - I mostly focused on completing the new Service_Weather library, adding basic tag navigation in Trean now that Chuck has migrated Trean away from shares to tags, and a buch of other small bug fixes. It was wonderful to see everybody in person again, a great time was had by all! I'm already itching for our next get together.

The ActiveSync library has also received a considerable amount of work in the last few months; Support for additional devices, improved recurrence series/exception support along with revamped timezone support to name a few. Going forward, I'm looking at implementing the minimum amount of email support that would be required to properly support meeting invitation requests and responses on the device. Once that is figured out, we'll see how much more work it would be for full email support (well, "full" support for what EAS 2.5 allows anyway). There is also talk about implementing a more recent version of the EAS protocol - at least 12.1 - which would give us the ability to not only sync more efficiently, but to sync with Apple's iCal application as well. Stay tuned!

Kronolith has a number of  missing features that haven't been implemented/ported from the traditional view yet. Some years ago, I added support for resource management. At the time, the AJAX view was not released, nor was it even fully functional, so the resource features were only added to the traditional view. These need to be ported to the dynamic view, along with better support for recurrence series editing.

All in all, another busy, but fun, year of Horde development is ahead!

Service_Weather for Developers Part 1

As promised in my last post, here is a basic run down on using Horde_Service_Weather in your own projects.

First, make sure you have the package installed. As of this writing, the latest available packaged release is 1.0.0RC2:

If you have not yet installed any Horde 4 packages, you will need to setup PEAR for Horde 4 (this is not meant to be a HOWTO on installing Horde. See the Horde install docs for more information).

// If you have not yet discovered Horde's PEAR channel:
pear channel-discover pear.horde.org

// Install the package:
pear install horde/Horde_Service_Weather

Next, we need to decide on the actual weather data provider. I recommend using Wunderground, as it is, by far, the most complete of the available choices. It requires registration for at least a free developer's account. Once you have your API key, you can create the weather object:

// Parameters for all driver types
// Note that below we use the global $injector to get the HttpClient and Cache instances.
// If not using the $injector, substitute your own instances in place of the $injector call.
$params = array(
    'http_client' => $injector->createInstance('Horde_Core_Factory_HttpClient')->create(),
    'cache' => $injector->getInstance('Horde_Cache'),
    'cache_lifetime' => 3600
);
$params['apikey'] = 'yourAPIKey';
$weather = new Horde_Service_Weather_WeatherUnderground($params);

Of course, if you choose to use, e.g., Google instead of Wunderground, just create the appropriate object:

// Google returns already localized strings,
// just pass it your language code.
$params['language'] = 'en';
$weather = new Horde_Service_Weather_Google($params);

Now we have our weather object, connected to the desired backend data provider. Let's fetch some weather information:

// Set the desired units
// Defaults to Horde_Service_Weather::UNITS_STANDARD
$weather->units = Horde_Service_Weather::UNITS_METRIC;

// Get current conditions.
// The location identifier can take a wide range of formats.
$conditions = $weather->getCurrentConditions('boston,ma');

// Unit labels
$units = $weather->getUnits();

// Basic condition description:
// e.g., "Sunny" or "Partly Cloudy" etc.
echo $conditions->condition;

// Current temp
echo $conditions->temp . $units['temp'];

Of course, lots of other properties are available. Check the documentation for details. Now, let's get a forecast:

// Get a 5 day forecast.
$forecast = $weather->getForecast('boston,ma', Horde_Service_Weather::FORECAST_5DAY);

// Each forecast result contains a collection of "Period" objects:
foreach ($forecast as $period) {
    echo 'Date: ' . (string)$period->date;  // Horde_Date object
    echo 'Hi: ' $period->high . $units['temp'];
    // Display other properties etc...
}

// If you want just a specific period:
$periodOne = $forecast->getForecastDay(0)
;
// Total snow accumulation for the day:
echo $periodOne->snow_total . $units['snow'];

Again, check the documentation for details on available properties.

In the next installment, we'll look at validating locations, searching locations and using a location autocompleter.

Have fun!

Service_Weather

With the recent discontinuation of The Weather Channel's public API access, Horde was left without a data feed for weather information other than the aviation style METAR/TAF reports. Weather information has historically been used  in two places in Horde; The WeatherDotCom portal block, and in the Timeobjects module, where we export the weather information to other applications - like Kronolith, Horde's calendaring application.

After an audit of available (and free) weather services, I settled on the following three services as suitable as alternatives to TWC's dead data feed.

Weather Underground: Of the three providers we decided to support, this one provides the most detailed data. You must sign up for an account for your Horde install. There is a free "developer" account option, though it does have relatively low usage limits which may be a problem if you have a large user base. We of course cache every request to help with getting the most out of those limits. They also offer very reasonable paid options as well.

World Weather Online: Another free service that provides a fair amount of data, though it's not as detailed as Weather Underground. Free account required, with higher limits than Weather Underground.

Google: Google does not provide an official weather API, but they do have an API interface that is used internally for Google's weather portal block. The data provided is not very detailed, but if you are looking for a provider that does not require any registration, this might be a solution for you.  No registration, no known limits, though this is unofficial, so keep that in mind.

It's worth noting that the biggest thing missing, even from Weather Underground's feed is the day/night forecast style. They provide an hourly forecast, but no simple day/night forecast. The non-hourly forecast data is provided as a single set of conditions for the entire day. Another fairly well known provider AccuWeather, appears to provide this (and fairly detailed data as well), but sadly, they have informed me that they no longer provide free data feeds - even for FOSS projects. Also, before anyone asks, yes I did look at Yahoo's weather feed. This is an RSS feed, which in and of itself is not a problem, but they only provided very basic data, for only a day or two in the future...not enough for our needs.

The end result of all this is the new Horde_Service_Weather library, a new Weather block, and support for the new weather drivers in the Timeobjects application for exporting the weather to applications like Kronolith.  As a side effect of all this, the weather support in Horde has, IMO, been greatly improved. The weather portal block code received a much needed overhaul including the ability to dynamically change the location being displayed directly from the portal screen, along with autocompletion of the locations.

At the time of this writing, Service_Weather is in Beta, and available via Horde's PEAR server. The new weather block is included in the most recent Horde release, and the latest Timeobjects release contains support for the new code as well.

For developers interested in learning how to use Service_Weather in their own applications - look forward to a blog entry in the near future detailing the usage.

Ansel exporter plugins available

I first wrote about my efforts to write an iPhoto export plugin for uploading images directly to Ansel from iPhoto back in November 2008. Three entire years ago. I wrote about my progress again in 2009 along with some screen shots. Since then, I've rewritten it twice and ported it to Aperture. I've been using these plugins myself as part of my workflow ever since.

 

Both Ansel versions 1.x and 2.x are supported by these uploaders. All metadata is retained during export, including keywords. You can create new galleries directly from the plugin, as well as browse a gallery's thumbnails so you can see what images have been previously uploaded. You may configure multiple Ansel servers as well.

I've finally gotten around to fulfilling my promise to publish a binary installer for these, so that users don't have to build them from scratch in XCode. You can now download these directly from Ansel's download page. Please keep in mind these are alpha-level releases. Feel free to report any issues you have to the ansel mailing list, or open a bug report at http://bugs.horde.org.