Archive for the ‘the front line’ Category

New features on Vino2Vino.com for wine bloggers

Thursday, March 29th, 2007

It’s been over a week since my last update, but in that time we’ve developed a whole bunch of cool new features, a number of which should be particularly interesting to bloggers. I’ll start with the more general additions.

We’ve integrated a full fledged wiki with Vino2Vino.com so that we can easily add historical, biographical, or other amorphous wine-related information to the system. Wiki articles for wineries show up on the winery page, as you can see on the pages for Larkmead Vineyards, Concannom, and Beaulieu Vineyard among others. In addition to the winery articles the wiki can be used to include information that would otherwise be missing from the system. For example, check out the articles for Mike Grgich (owner/operator of Grgich Hills), André Tchelistcheff, and The Wine Group.

We’ve also made some improvements in the UI department with a new profile page (you can find it by clicking “My Profile” at the top of the page after logging in) as well as a new look for the wine lists page. There’s new functionality here too. On the profile page you can upload your own picture (or “avatar“), and on the wine lists page you can browse any number of user-created lists as well as auto-generated lists that show wines you’ve rated, commented on, tagged, or blogged! Which brings me to the new features for bloggers…

From what I’ve been reading around the web, wine bloggers are not that impressed with the current generation of “Wine 2.0″ websites. One common complaint is that these systems offer no easy way to cross-post a blogged wine review (or to interact with blogging software at all for that matter). We’re working hard to address these concerns, and have started by implementing Linkbacks (pingbacks really) so that bloggers who link to a V2V wine or winery page from a post, and have pingbacks enabled, will automatically see a reciprocal link back from that page to their blog post. For example, if I link to a couple of wines I’ve found particularly good recently, you’ll see links back to this page on the V2V page for each wine. We’re of the opinion that this mechanism will benefit us, bloggers, and users in general by creating an aggregated list of blog posts that discuss individual wines and wineries. So next time you discuss individual bottles of wine in a blog post, link back to V2V so your readers can find additional info about each bottle, and ours can find out what you thought!

Even cooler, if you have an account on V2V you can go to your profile page and associate your blog with your account. (If you don’t have an account, get one now! it’s free, and it only takes about 30 seconds… what are you waiting for?) After linking your V2V account and your blog, you will be able to view a list of wines you’ve blogged about on your wine lists page. And just like any other list, you can export your list of blogged wines in the form of a wine widget or an XML Feed. Check out the widget displaying my blogged wines (to the right) for an example.

There are a number of other improvements and new features around the site, but this post is getting long so I’ll let you explore and find them on your own. We’re very excited about the new features, the blogging features in particular, and would love to hear what you have to say, so leave a comment or shoot us an email.

How to turn an XML feed into something useful

Tuesday, March 13th, 2007

Before we begin, a warning: this post is fairly technical, so if you’re looking for some light wine-related reading I suggest you skip this article. I’m assuming you already know at least the basics of working with XML and PHP (though not necessarily using them together). If you’ve never heard of these technologies, then what follows will likely be completely meaningless to you.

If you’re used to working with XML, but have never bothered to learn about XSL/XSLT, you’re missing out. XSLT, or eXtensible Stylesheet Language Transformations, is an XML language that can transform an XML document into something else… What else? Well, theoretically, anything that can be represented as ones and zeros. We’ll be using it to transform Vino2Vino’s XML wine feeds into a variety of useful formats.

To begin, we need an XML source document. I’ll be working with my personal wine list from Vino2Vino.com, which is located at http://vino2vino.com/feed/wine/mike, and looks something like this:


<?xml version="1.0" encoding="UTF-8"?>
<wines count="9">
  <link>
    http://www.vino2vino.com/feed/wine/mike
  </link>
  <wine id="38681">
    <color>unknown</color>
    <name>Amarone della Valpolicella
       Classico Campolongo di Torbe</name>
    <year>1999</year>
    <production-volume>1600</production-volume>
    <winery id="2436">Masi</winery>
    <region id="57" country="IT" continent="EU">
      Veneto
    </region>
    <price>85</price>
    <ratings>
      <rating by="V2V">85</rating>
      <rating by="WS">90</rating>
    </ratings>
    <tags>
      <tag>silky</tag>
      <tag>rich</tag>
      <tag>full bodied</tag>
      <tag>full</tag>
      <tag>plums</tag>
    </tags>
  </wine>
  ...
</wines>

If you’re working with a different markup language you’ll need to adjust the examples accordingly.

Let’s convert our XML feed into a format that a normal feed reader can understand, that way I can subscribe to my wine feed and have it show up on my Google homepage, in the sidebar of my blog, etc. All I really want are the names of the wines with links to the wine info page for each wine in my list. Here’s a simple XSLT file to convert our XML feed to RSS 2.0:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" indent="yes"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
  <xsl:template match="/">
    <rss version="2.0">
      <channel>
        <title>My Vino2Vino.com RSS Feed</title>
        <description>My Vino2Vino.com RSS Feed</description>
        <link><xsl:value-of select="/wines/link"/></link>
        <xsl:apply-templates select="/wines/wine"/>
      </channel>
    </rss>
  </xsl:template>
  <xsl:template match="wine">
    <item>
      <title>
        <xsl:value-of
          select="concat(winery, ' ', year, ' ', name)"/>
      </title>
      <description>
        <xsl:value-of select="color"/> wine from
        <xsl:value-of
          select="concat(region, ', ', region/@country)"/>
      </description>
      <link>
        http://www.vino2vino.com/wine/<xsl:value-of
          select="@id"/>
      </link>
      <guid>
        http://www.vino2vino.com/wine/<xsl:value-of
          select="@id"/>
      </guid>
      <source url="{/wines/link}">
        <xsl:value-of
          select="concat(winery, ' ', year, ' ', name)"/>
      </source>
    </item>
  </xsl:template>
</xsl:stylesheet>

Next, we need to apply the transformation to our XML feed and print the output. The PHP code to perform this operation is trivial, so I won’t bother explaining it. If you want more details, check out the PHP online documentation. Here’s the code:


$xmlFile = 'http://vino2vino.com/feed/wine/mike';
$xslFile = 'rss.xsl';

// Initialize XSLTProcessor by passing it a
// DOMDocument object loaded with XSL file
$xsl = new XSLTProcessor();
$xsl->importStyleSheet(DOMDocument::load($xslFile));

// Load source XML into DOMDocument object
$dom = DOMDocument::load($xmlFile);

print($xsl->transformToXml($dom));

If you place this script on your web server you can point an RSS reader at it and keep an eye on your wine lists! The output from this script looks something like this:


<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>My Vino2Vino.com RSS Feed</title>
    <description>My Vino2Vino.com RSS Feed</description>
    <link>http://vino2vino.com/feed/wine/mike</link>
    <ttl>30</ttl>
    <item>
      <title>Masi 1999 Amarone della Valpolicella
          Classico Campolongo di Torbe</title>
      <description>unknown wine from Veneto, IT</description>
      <link>http://www.vino2vino.com/wine/38681</link>
      <pubDate>Tue, 13 Mar 2007 05:54:24 GMT</pubDate>
      <guid>http://www.vino2vino.com/wine/38681</guid>
      <source url="http://vino2vino.com/feed/wine/mike">
        Masi 1999 Amarone della Valpolicella
        Classico Campolongo di Torbe
      </source>
    </item>
    ...
  </channel>
</rss>

I’ve put together a couple of useful transformations in a zip file for you to play with. The zip contains stylesheets to convert XML feeds from Vino2Vino.com into RSS, JSON, and HTML. Check it out!

Another day, another new feature

Saturday, March 3rd, 2007

Registration ConfirmationIt’s been another long day, and we’ve made a number of improvements that will hopefully make Vino2Vino more usable, and more fun too. First of all, the registration process now sports a totally revamped confirmation page. And, we’re beginning to collect some additional information (optional, of course) that will help us improve our wine recommendations and personalize the site to meet your needs. If you’ve already signed up, and would like to enhance your profile, click here.

We’ve also added search capabilities to each wine’s profile page. You’ll find links in the right navigation panel, near the top, that will perform searches on WineZap, Wine-Searcher, and FreeWineSearcher. If you can’t find a wine on any of these sites, you probably won’t find it anywhere!

Find Wine Box

Oh yea, and don’t forget to try out SMS Messaging through 4-Info next time you’re at a restaurant and are overwhelmed by the wine list. We’ll continue to refine the results we return for SMS queries, but it’s definitely ready for use.

So, things are moving along. We’ll continue to improve if you continue to drink, rate, and review wines. Deal? If you have any thoughts or suggestions, fell free to email us, we love getting feedback!

News from the front line

Thursday, March 1st, 2007

It’s been a busy 24 hours (give or take) since our official beta launch, but given that I am “chief technology guy” it’s only fair that I take some time off coding to tell you, our loyal fans, about some of the ideas we’re currently working on here at V2V.

First off, to our new friends in España (english version), we’re working hard on internationalization, which would allow you to browse the site in your native language (or your other native language). It’s a lot of work, so don’t expect to see anything done tomorrow, but progress is being made. In response to the comment on the site’s aesthetics (which translates roughly to “the aesthetics suck”), I can only say that 1) that’s what you get when a programmer does design work, and 2) we’re working on it. Expect minor tweaks in the interface and design short-term, with a major overhaul likely down the road. We’re pretty devoted to usability so if you have any ideas feel free to comment, or drop us a line.

Next, we’re working on a nifty wine widget feature that will allow you to incorporate wine ratings, reviews, etc. into your website. It’s just an idea at the moment, but things are developing rapidly, so check back for updates here in the next couple of days. For those of you who are a bit more experimental, feel free to play around with the XML feeds we’re using to create the widgets (this one’s for my wine list, you can also pass parameters like “rating=90″, “rating-gt=90″, “year=2003″, etc). It’s my hope that these feeds/widgets will grow into a full fledged developers API in the spirit of Flickr, Facebook, and Blogger.

Anyways, we have a ton of ideas for neat features and improving user experience, but I better get back to coding, lest they remain ideas. I’ll be posting updates here as things develop, so be sure to check back from time to time for the latest news from the front line.