Julien

I used Firebug to look at the URL that your code fetched from Google 
Calendar, and this was the JSON that it returned:

{
    "version":  "1.0",
    "encoding": "UTF-8",
    "feed":     {
        "xmlns":                   "http://www.w3.org/2005/Atom";,
        "xmlns$openSearch":        
"http://a9.com/-/spec/opensearchrss/1.0/";,
        "xmlns$batch":             "http://schemas.google.com/gdata/batch";,
        "xmlns$gCal":              "http://schemas.google.com/gCal/2005";,
        "xmlns$gd":                "http://schemas.google.com/g/2005";,
        "id":                      {
            "$t": 
"http://www.google.com/calendar/feeds/7uf7k6v3nae56rtgt7nj1mro9k%40group.calendar.google.com/public/full";
        },
        "updated":                 {
            "$t": "2008-12-26T12:01:53.000Z"
        },
        "category":                [
            {
                "scheme": "http://schemas.google.com/g/2005#kind";,
                "term":   "http://schemas.google.com/g/2005#event";
            }
        ],
        "title":                   {
            "type": "text",
            "$t":   "timeline"
        },
        "subtitle":                {
            "type": "text",
            "$t":   ""
        },
        "link":                    [
            {
                "rel":  "alternate",
                "type": "text/html",
                "href": 
"http://www.google.com/calendar/[email protected]";
            },
            {
                "rel":  "http://schemas.google.com/g/2005#feed";,
                "type": "application/atom+xml",
                "href": 
"http://www.google.com/calendar/feeds/7uf7k6v3nae56rtgt7nj1mro9k%40group.calendar.google.com/public/full";
            },
            {
                "rel":  "http://schemas.google.com/g/2005#batch";,
                "type": "application/atom+xml",
                "href": 
"http://www.google.com/calendar/feeds/7uf7k6v3nae56rtgt7nj1mro9k%40group.calendar.google.com/public/full/batch";
            },
            {
                "rel":  "self",
                "type": "application/atom+xml",
                "href": 
"http://www.google.com/calendar/feeds/7uf7k6v3nae56rtgt7nj1mro9k%40group.calendar.google.com/public/full?alt=json-in-script&max-results=15&start-min=2006-04-01T00%3A00%3A00&sortorder=ascending&singleevents=true&orderby=starttime&futureevents=true";
            }
        ],
        "author":                  [
            {
                "name":  {
                    "$t": "Julien Bayle"
                },
                "email": {
                    "$t": "[email protected]"
                }
            }
        ],
        "generator":               {
            "version": "1.0",
            "uri":     "http://www.google.com/calendar";,
            "$t":      "Google Calendar"
        },
        "openSearch$totalResults": {
            "$t": "0"
        },
        "openSearch$startIndex":   {
            "$t": "1"
        },
        "openSearch$itemsPerPage": {
            "$t": "15"
        },
        "gd$where":                {
            "valueString": ""
        },
        "gCal$timezone":           {
            "value": "Europe/Paris"
        },
        "gCal$timesCleaned":       {
            "value": "0"
        }
    }
}

Note that your displayResults function tried to get "json.feed.entry", 
but in this JSON blob there is no "entry" field. You should check with 
Google Calendar API to see how you're supposed to use it.

I'd recommend using Firebug for Firefox and calling
    console.log(json);
in order to inspect the JSON result.

David


julienb wrote:
> David,
> could you help me?
> I'm a little bit stuck ?!
>
>
> the following script seems to be correct.
> if  links[j].rel == "http://schemas.google.com/gCal/2005/webContent";
> isn't true anymore, indeed the webContent object won't be never
> filled!
>
> but I stay stuck here... could you help me?
> I really don't understand where is the problem...
> I have a calendar public, an xml feed from it, a script (the same that
> in the link above where it works) ... and it doesn't :-(
>
>
> function loadGDataCallback(json) {
>   var entries = json.feed.entry;
>   var timelinerEntries = [];
>   for (var i = 0; i < entries.length; ++i) {
>     var entry = entries[i];
>     var when = entry["gd$when"][0];
>     var start = convertFromGDataDate(when.startTime);
>     var end = convertFromGDataDate(when.endTime);
>     var webContent;
>     var links = entry.link;
>     for (var j = 0; j < links.length; ++j) {
>       if (links[j].rel == "http://schemas.google.com/gCal/2005/
> webContent")
>         {
>         webContent = links[j];
>       break;
>       }
>     }
>     var title = webContent.title;
>     var link = webContent["gCal$webContent"].url;
>     var icon = webContent.href;
>     var description = '<img src="' + link + '">';
>     timelinerEntries.push(new Timeline.DefaultEventSource.Event(
>       start,
>       null, // end - when not set, event displayed with icon (looks
> better)
>       null, // latestStart
>       null, // latestEnd
>       false, // not isDuration
>       title,
>       description,
>       null, // image
>       null, // link - destination when clicking on title
>       icon,
>       undefined, // color
>       undefined  // textColor
>     ));
>   }
>   gEventSource.addMany(timelinerEntries);
> };
>
>
>
> On 23 déc, 20:31, David Huynh <[email protected]> wrote:
>   
>> I'd recommend using Firebug for Firefox to debug. It shows
>>
>>     webContent is undefined - test (line 25)
>>
>> David
>>
>> julienb wrote:
>>     
>>> Hi,
>>>       
>>> I just discovered simile timeline could be fed by JSON flow from any
>>> sources...
>>>       
>>> I did that:http://www.julienbayle.net/test/
>>> based on the 
>>> template:http://code.google.com/intl/fr/apis/gdata/samples/cal_simile_sample.html
>>>       
>>> but mine doesn't work :-(
>>>       
>>> could someone help me ??
>>>       
>>> I shared my calendat to everyone
>>> I did several dummy events etc etc
>>>       
>>> julien
>>>       
> >
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to