Revision as of 12:41, 3 August 2009 by tanjaluodes (Talk | contribs)

Archived:Example Syndication Service in WidSets

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.


This script code uses the Syndication service to fetch the 10 most recent items from the www.digg.com RSS feed.


  void startWidget()
    setMinimizedView(createMinimizedView("viewMini", getStyle("default")));

  Shell openWidget()
    return null;

  void fetch()
    //As we do not have any content yet, we want all feed items
    //since the year 1970 (usually RSS feeds contain 20-30 items).
    Value arg = [
      "ts" => 0,
      "max" => 10

    call(null, "syndService", "getItems", arg, ok, nok);

  void ok(Object state, Value ret)
    setBubble(null, "Got "+ret.size()+" items");
    //print subjects to log
    foreach (Value item : ret) {
      printf("subject: "+item.title);

  void nok(Object state, String error)
    setBubble(null, "Syndication get failed: "+error);

} //class


<?xml version="1.0" encoding="utf-8"?>
<widget spec_version="2.0">
    <shortdescription>Syndication Service Example</shortdescription>
    <longdescription>Syndication Service Example</longdescription>
    <tags>example syndicationservice</tags>
    <parameter name="widgetname">Syndication Service</parameter>
    <parameter type="url" name="url" editable="false">

    <service type="syndication" id="syndService">
      <reference from="url" to="feedurl"/>
    <code src="syndication_service.he"/>
      mini {
        background: solid white;
        color: black;
        align: vcenter hcenter;
      maxi {
        background: solid white;
        padding: 5 5 5 5;
      flow {
        background: solid white;
  <layout minimizedheight="2em">
    <view id="viewMini" class="mini">
      <label class="mini">${widgetname}</label>
61 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.