// json989533 is the name of the internal JavaScript object
// it is unique to the current representation
json989533 =
{
"type": "rss",
"version": "rss10",
"nvFeed": 1,
"htmlUrl": "http://blog.netvibes.com/",
"title": "Netvibes Blog",
"content": "Netvibes.com development blog"
"items":
[
{
// the id is generated from the post URL
"id": "httpblognetvibescom20060628netvibesnewfeaturespreview",
"title": "Netvibes new features review",
"link": "http:\/\/blog.netvibes.com\/?2006\/06\/28\/netvibes-new-features-preview",
"content": "A post with an enclosure<\/p>",
"date": "Jun 28, 2006 11:18:31 GMT",
"enclosures":
[
{
"type": "image/png",
"url": "http://blog.netvibes.com/images/20060531-launch/account-change.png"
}
]
},
{
"id": "httpblognetvibescom20060624netvibesintroduces",
"title": "Netvibes introduce Keyboard control",
"link": "http:\/\/blog.netvibes.com\/?2006\/06\/24\/netvibes-introduces",
"content": "
This is our HTML content<\/p>",
"date": "Jun 24, 2006 11:18:31 GMT"
}
]
}
The ''UWA.Data.getFeed(url, callback)'' method is used in the following way:
var MyWidgetName = {}
MyWidgetName.display = function(feed) {
widget.setBody(
"" +
"The feed for '" + feed.title +
"' contains " + feed.items.length +
" entries." +
"
"
);
}
// The following code will fire when the widget is loaded
widget.onLoad = function() {
// widget.getValue('url') : the value for the preference tag named 'url'
// MyWidgetName.display : the function fired when the request is successful
UWA.Data.getFeed(widget.getValue('url'), MyWidgetName.display);
}
=====The JSON feed format=====
j-feed =
{
"name": "j-feed",
"description" : "A format to describe Feeds",
"url": "http://example.org/schemas/j-feed",
"type": "object",
"members":
[
{ "name": "nvFeed" },
{ "name": "htmlUrl" },
{ "name": "title" },
{ "name": "description" },
{
"name": "items",
"type": "array",
"members": j-feed-item
}
]
}
j-feed-item =
{
"name": "j-feed-item",
"description": "A format to describe Feed items",
"url": "http://example.org/schemas/j-feed-item",
"type": "object",
"members":
[
{ "name": "id" },
{ "name": "title" },
{ "name": "content" },
{ "name": "author" },
{ "name": "date" },
{
"name": "enclosures",
"type": "array",
"members": j-feed-enclosure
}
]
}
j-feed-enclosure =
{
"name": "j-feed-enclosure",
"description": "A format to describe Feed enclosures",
"url": "http://example.org/schemas/j-feed-enclosure",
"type": "object",
"members":
[
{ "name": "url" },
{ "name": "type" }
]
}
Continue to [[:uwa_specification:uwa_skeleton|a sample UWA skeleton]]...