Author Archive

Vino2Vino Google Gadget Released

Wednesday, April 25th, 2007


We’re keeping busy here at Vino2Vino coming up with clever new ways to help you discover and learn about great wine. We also like it when things are convenient, and easy to use. And what’s more convenient than having the latest updates from your favorite wine-review website show up right on your personalized Google homepage?

The gadget is not in the official Google Gadget directory yet (it’s pending approval… yawn), but you can beat the crowd and start using it now. How? Simple! First you’ll need a Google Personalized Homepage (if you don’t have one already). Once that’s out of the way simply click here to add the V2V New Wines Gadget to your homepage. It’s that easy. No fuss, no muss. As always, we love feedback, so let us know how we can improve Vino2Vino for you!

Wordpress Digg Widget

Saturday, April 14th, 2007

I was taking a break from coding earlier and found a blog post on digg requesting a digg widget that would show your friends digg activity. It seemed like a pretty good idea, so I threw together a quick proof of concept. The styling isn’t great, but it works! Check out the sidebar here (on the homepage) for an example.

You can download the plugin here. Place it in the plugins directory for Wordpress then activate it under plugins (it’s called diggfriends). Once you’ve done that you can place a call to the digg_friends() function anywhere in your theme files and it will create a list of what your friends have dugg! The function takes one argument, your username, passed as a string.

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.

Winery Mapping on Vino2Vino.com

Monday, March 19th, 2007

Map of Napa Valley, California

Last Friday we quietly added a new (beta) mapping feature to Vino2Vino.com. The interface is based on Google’s wonderful maps API which allows you to easily include maps of the entire globe on any publicly available website. On top of Google maps, we’ve placed markers for over 1,100 geocoded wineries. You can easily explore all of these wineries on a single page, without being overwhelmed, thanks to clustering that occurs at higher zoom levels (see the screen shot on the right, which shows a map of Napa Valley). If you click on a cluster, an info window pops up showing the address and contact information for any wineries the cluster covers (note that it may take a few seconds for an info window to pop up for large clusters - we’re working on improving the speed).

Map thumbnails appear on the winery page for geocoded wineries, in the right side bar (full maps also appear on certain region pages, like Napa Valley). Clicking the marker on a map thumbnail will load a larger map overlay showing the surrounding geographic region along with any nearby wineries. From there you’re free to explore the entire world!

Wineries around the globe

New layout, logo, and other new stuff

Tuesday, March 13th, 2007

So, in case you haven’t noticed (or haven’t been here before), Vino2Vino.com got a new logo and some new graphics today (mmm, gradients). The changes are subtle, but I think it’s a big improvement!

The site got some less obvious enhancements as well. We’ve made some backend optimizations that should speed up the load time for many pages, and we’ve added RSS feeds on the home page. You can subscribe to feeds for recently updated, best values, and top rated wines on Vino2Vino.com. Keep an eye out for more feeds to come, including personalized feeds for your wine lists.

Be sure to check back frequently this week. I’m back from spring break and ready to roll, so things will be happening fast.

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!