Atom feed extensions for Google Data

Topics: Argotic.Extensions
Aug 7, 2008 at 8:20 PM
I am trying to write a small Contact Manager module for playing around with Google Contacts and I'm really impressed at to how Argotic handles atom feeds. I am a little lost on getting the extended elements from the feeds. A sample contact entry looks like this -

    <category scheme="" term="" />
    <title type="text">Atom Tester</title>
    <link rel="" type="image/*" href="" />
    <link rel="self" type="application/atom+xml" href="" />
    <link rel="edit" type="application/atom+xml" href="" />
    <gd:email rel="" address="" primary="true" />

Other contact information include phone numbers, addresses, etc and come in extended gd: tags. I did see an example on using ITunes extended feeds but am a bit clueless as to where I should start, for writing my own extension for Google data.

Any help/comments/suggestion would be great!
Aug 8, 2008 at 8:37 PM
You correct that you will need to write a custom syndication extension in order to consume and/or persist Google Data extension information in a syndication feed. The Google Data extension specification may be found at The XML namespace that will be used by the custom extension will be xmlns:gd=, and the default XML prefix will be gd.

I have not yet had time to write a Wiki entry describing the process of creating custom sysndication extensions, and so I apologize for the confusion. To create a custom syndication extension within the Argotic framework, you start by creating a class that inherits from the Argotic.Extensions.SyndicationExtension abstract base class. Within the default constructor of your custom class you will need to call the base SyndicationExtension(string xmlPrefix, string xmlNamespace, Version version, Uri documentation, string name, string description) constructor and provide the parameter values that map to your custom extension.

A good way to get started on writing custom syndication extensions is to take a look at the source code of the core extensions natively supported by the Argotic framework. The source code is included with the framework installer, and I would suggest looking at the BasicGeocodingSyndicationExtension extension in the Argotic.Extensions.Core namespace.

I will add a feature request to implement and support the Google Data extension for a future release. Please feel free to contact me directly if you have any questions after taking a look at how syndication extensions are implemented in the framework source code.


Feb 2, 2011 at 12:36 PM
Edited Feb 2, 2011 at 12:37 PM


I'm trying to do something similar, but instead of making an extension, I'm trying to find the extensions and the collect the data within.

I'm looking at a feed received by a Google Search API for Shopping query, bringing back a list of products. An example feed might be (some entries truncated):

<?xml version="1.0" encoding="UTF-8"?>
<feed gd:kind="shopping#products" gd:etag="&quot;SLO3SiyTPqTJi6N3OtRrdM3n4Ko/0TxmNee_K5BUVQfRPlvykx2AeZo&quot;" xmlns="" xmlns:gd="" xmlns:openSearch="" xmlns:s="">
<title>Shopping Products</title>
<generator version="v1" uri="">Search API for Shopping</generator>
<link rel="alternate" type="text/html" href=""/>
<link rel="" type="application/atom+xml" href=""/>
<link rel="self" type="application/atom+xml" href=";q=mp3+player&amp;alt=atom&amp;rankBy=price:ascending&amp;maxResults=10&amp;startIndex=1"/>
<link rel="next" type="application/atom+xml" href=";q=mp3+player&amp;alt=atom&amp;rankBy=price:ascending&amp;maxResults=10&amp;startIndex=11"/>
<link rel="previous" type="application/atom+xml"/>

<entry gd:kind="shopping#product">
<title>i-nique GeeBee 4 In 1 MP3 Player Sports Armband / Large / Black</title>
<content type="text">&quot;The coolest looking arm band on the block - 3 months in developme...</content>
<link rel="alternate" type="text/html" href=""/>
<link rel="self" type="application/atom+xml" href=""/>
<s:title>i-nique GeeBee 4 In 1 MP3 Player Sports Armband / Large / Black</s:title>
<s:description>&quot;The coolest looking arm band on the...</s:description>
<s:inventory channel="online">
<s:price currency="GBP">3.75</s:price>
<s:image link=""/>

Now Argotic (and the MS Syndication lib) finds entries perfectly. The problem for both is when nested Extensions come into play - is it possible for Argotic to see these? The MS Syndication lib manages to find the <s:product> tag but it doesn't go down any deeper than that.
From what I've read, it would appear that the idea is to define a list of custom extension classes (seems a bit tedious but ok) then add these to the SyndicationResourcesLoadSettings.SupportedExtensions then load the feed with the settings, is this correct?

I've tried following your instructions and made the following constructor for the GExtension : SyndicationExtension class

public GExtension()
                : base("product", "", new Version("1.0"), new Uri(""),
                        "GoogleShoppingExtensions", "Extensions for displaying product data.")
            { }

then added the required method signatures, but I'm not entirely sure as to where to proceed afterwards.

I did:

 SyndicationResourceLoadSettings srls = new SyndicationResourceLoadSettings();
srls.AutoDetectExtensions = true;
AtomFeed af = AtomFeed.Create(new Uri(uriStr), srls);

But it just brings up an extension collection when I examine it during debugging.