Datasets – Singapore Tourism Board (STB)

Singapore Tourism Board
The Singapore Tourism Board (STB) is the leading economic development agency in tourism, one of Singapore’s key service sectors. Known for partnership, innovation and excellence, the Board champions tourism and builds it into a key economic driver for Singapore. While STB continues to perform its tourism promotion functions, it will also fulfil a much broader economic development role for the tourism sector.

Datasets Available

Dataset Description URL Metadata
Event Updates of events in Singapore http://api.projectnimbus.org/stbodataservice.svc/EventSet Click Here
MICE Organizers MICE organizers in Singapore http://api.projectnimbus.org/stbodataservice.svc/MICE_OrganizerSet Click Here
Places Places of Interests in Singapore http://api.projectnimbus.org/stbodataservice.svc/PlaceSet Click Here
Hotels Hotels in Singapore http://api.projectnimbus.org/stbodataservice.svc/HotelSet Click Here

Code Snippet

.NET – How do I access a complete list of events based on industry

public List<EventsEntry> GetEventFromNimbusSTB(string AccountKey, string UniqueUserID)
    {

        System.Net.WebRequest wr=
          HttpWebRequest.Create(
            "http://api.projectnimbus.org/stbodataservice.svc/EventSet?Industry=INFORMATION COMMUNICATION TECHNOLOGY (ICT)");
        wr.Headers.Add("AccountKey",AccountKey);
        wr.Headers.Add("UniqueUserID",UniqueUserID);
        wr.Method = "GET";
        WebResponse res = wr.GetResponse();
        string resStr
         = new System.IO.StreamReader(res.GetResponseStream()).ReadToEnd();

        XNamespace atomNS
          = "http://www.w3.org/2005/Atom";
        XNamespace dNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices";
        XNamespace mNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";

        List<EventsEntry> results
          = (from item in XElement.Parse(resStr).Descendants(atomNS + "entry")
            let events = item.Element(atomNS + "content").Element(mNS +"properties")
                select new EventEntry() {
                EventID events.Element(dNS +"EventID").Value,
                Organizer = events.Element(dNS +"Organizer").Value,
                Industry = events.Element(dNS + "Industry").Value,
                Name = events.Element(dNS + "Name").Value
            }).ToList();

        return results;
    }

Java – How do I access a complete list of events based on industry

public ArrayList<Events> getEventsByIndustry(String accountKey, String uniqueId) {
  eventList = new ArrayList<Events>();
  try {
    URL _url = new URL("http://api.projectnimbus.org/stbodataservice.svc/EventSet?Industry=INFORMATION COMMUNICATION TECHNOLOGY (ICT)");
    URLConnection _urlConn = _url.openConnection();
    _urlConn.setRequestProperty("accept", "*/*");
    _urlConn.addRequestProperty("AccountKey", accountKey);
    _urlConn.addRequestProperty("UniqueUserID", uniqueId);
    BufferedReader br = new BufferedReader(new InputStreamReader(_urlConn.getInputStream()));
    String line = null;
    StringBuilder strBuilder = new StringBuilder();
    while ((line = br.readLine()) != null) {
      strBuilder.append(line);
      System.out.println(line);
    }
}

String[] IProperties = strBuilder.toString().split("<m:properties>");
    for (String str : IProperties) {
      Events evts = new Events();
      evts.setEventID(Utils.getStringBetween(str, "<d:EventID m:type=\"Edm.Int32\">", "</d:EventID>"));
      evts.setOrganizer(Utils.getStringBetween(str, "<d:Organizer>", "</d:Organizer>"));
      evts.setIndustry(Utils.getStringBetween(str, "<d:Industry>", "</d:Industry>"));
      evts.setName(Utils.getStringBetween(str, "<d:Name>", "</d:Name>"));
      eventList.add(evts);
      }
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    } catch (IOException ex) {
        ex.printStackTrace();
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return eventList;
}

Helpers Available

.NET – C# Proxy Classes: click here | Read this blog post for more information to use these proxy classes.

JAVA – Read this blog post for more information to use JAVA to connect to the data service.

PHP & AJAX – Read this blog post for more information to use PHP/AJAX to connect to the data service.

obj C / xcode – coming soon

Terms of Use

The datasets:

  • Are here as a community technology preview for a period of time (TBD).
  • Cannot be used in any public offering.
  • Are offered as-is with no official support.

Support

None at this time.

Advertisement
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Datasets – Singapore Tourism Board (STB)

  1. Pingback: What is Project Nimbus? How do I get started? « Project Nimbus

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s