18
Windows Live Development Series Session 2: Site-Centric Services [presenter info]

Windows Live Technical Development Series Part 2

Embed Size (px)

Citation preview

Page 1: Windows Live Technical Development Series   Part 2

Windows Live Development SeriesSession 2: Site-Centric Services

[presenter info]

Page 2: Windows Live Technical Development Series   Part 2

Series Agenda

• Session 1: Overview– Platform overview, service access, integration

• Session 2: Site-Centric Services– Search, Silverlight Streaming, Virtual Earth, Expo

• Session 3: User-Centric Services– Live ID, Spaces, Photos, Contacts, Messenger,

Alerts

Page 3: Windows Live Technical Development Series   Part 2

Session Agenda

• Search• Silverlight Streaming• Virtual Earth• Expo

Page 4: Windows Live Technical Development Series   Part 2

Live Search

• Client-side HTML forms• Server-side Web services

Page 5: Windows Live Technical Development Series   Part 2

Live Search: Client-side

• Add a search box to your site in HTML• Benefits– Doesn’t require server-side development– Doesn’t impact server performance

• Drawbacks– Don’t [easily] get insight into visitor searches

Page 6: Windows Live Technical Development Series   Part 2

Basic Search Box For Site<form method="get" action="http://search.live.com/results.aspx"> <input type="hidden" name="cp" value="437" /> <input type="hidden" name="FORM" value="FREESS" /> <table bgcolor="#FFFFFF"> <tr> <td> <a href="http://search.live.com/"> <img src="http://search.live.com/s/affillogoLive.gif"

border="0" alt="Live Search"/> </a> </td> <td> <input type="text" name="q" size="30" /> <input type="submit" value="Search Site" /> <input type="hidden" name="q1" value="site:microsoft.com"/><!– or your site --> </td> </tr> </table></form>

Page 7: Windows Live Technical Development Series   Part 2

Advanced Search Box For Site & Web

Page 8: Windows Live Technical Development Series   Part 2

Advanced Search Box For Site & Web*<meta name="Search.WLSearchBox" content="1.1, en-US" /><div id="WLSearchBoxDiv"><table cellpadding="0" cellspacing="0" style="width: 322px"><tr id="WLSearchBoxPlaceholder"><td style="width: 100%; border:solid 2px #4B7B9F;border-right-style: none;"><input id="WLSearchBoxInput" type="text" value="&#x4c;&#x6f;&#x61;&#x64;&#x69;&#x6e;&#x67;&#x2e;&#x2e;&#x2e;" disabled="disabled" style="padding:0;background-image: url(http://search.live.com/s/siteowner/searchbox_background.png);background-position: right;background-repeat: no-repeat;height: 16px; width: 100%; border:none 0 Transparent" /></td><td style="border:solid 2px #4B7B9F;"><input id="WLSearchBoxButton" type="image" src="http://search.live.com/s/siteowner/searchbutton_normal.png" align="absBottom" style="padding:0;border-style: none" /></td></tr></table>

<script type="text/javascript" charset="utf-8">var WLSearchBoxConfiguration={

"global":{"serverDNS":"search.live.com","market":"en-US"

},"appearance":{

"autoHideTopControl":false,"width":600,"height":400,"theme":"Blue"

},"scopes":[

{"type":"web","caption":"&#x4d;&#x69;&#x63;&#x72;&#x6f;&#x73;&#x6f;&#x66;&#x74;","searchParam":"site:www.microsoft.com"

},{

"type":"web","caption":"&#x57;&#x65;&#x62;","searchParam":""

}]

}</script><script type="text/javascript" charset="utf-8" src="http://search.live.com/bootstrap.js?market=en-

US&ServId=SearchBox&ServId=SearchBoxWeb&Callback=WLSearchBoxScriptReady"></script></div>

*- Or just use the easy wizard at http://search.live.com/siteowner

Page 9: Windows Live Technical Development Series   Part 2

Live Search Web Service

• SOAP API for searching:– Ads, Images, InlineAnswers, News, PhoneBook,

QueryLocation, Spelling, Web, WordBreaker

• Free access with up to 25,000 queries per day per IP address– Commercial usage terms available

Page 10: Windows Live Technical Development Series   Part 2

Sample Search API CodeMSNSearchService service = new MSNSearchService();SearchRequest request = new SearchRequest();

// You can search multiple sources at once and ask for any of the fields.// We search Web only here and ask for just the title and URL of the result.request.Requests = new SourceRequest[1];request.Requests[0] = new SourceRequest();request.Requests[0].Source = SourceType.Web;request.Requests[0].ResultFields = ResultFieldMask.Title | ResultFieldMask.Url;

request.CultureInfo = "en-US";request.Query = "QUERY TEXT";request.AppID = "APP_ID"; // Get from http://search.msn.com/developer

foreach (Result result in service.Search(request).Responses[0].Results){ // Process search result...}

Page 11: Windows Live Technical Development Series   Part 2

Silverlight Streaming

• Online service for hosting Silverlight applications• Applications served from Microsoft servers– Great scalability and availability

• Limitations– 4GB total storage (to be removed eventually)– Videos cannot exceed 10 minutes in runtime or

~20MB– Peak outbound rate is 700 Kbps (if streaming media)

• No limitation on media quality or encoding

Page 12: Windows Live Technical Development Series   Part 2

Silverlight Streaming Setup

• Administration– Create an account at http://silverlight.live.com to get

an account ID and secret key• Content preparation– Uploads are in ZIP format

• Using admin browser interface• Using REST API

• End users– Require the Silverlight runtime– Everything else is HTML/JavaScript

Page 13: Windows Live Technical Development Series   Part 2

Silverlight Streaming Infrastructure

Page 14: Windows Live Technical Development Series   Part 2

Silverlight OS/Browser SupportOS*/Browser IE6 SP2 IE 7.0 FireFox

1.5.x.x FireFox 2.0 Mac Safari 2.0.4

Windows XP Gold/SP1/SP2 Supported Supported Supported Supported Not Applicable

Windows Vista

Not Applicable Supported Supported Supported Not Applicable

Windows 2000

Not Supported; Planned

Not Supported; Planned

Not Supported; Planned

Not Supported; Planned

Not Applicable

Mac OS 10.4.8 PPC

Not Applicable

Not Applicable

Not Supported; Planned

Not Supported; Planned

Supported

Mac OS 10.4.8 Intel

Not Applicable

Not Applicable Supported

Not Supported; Planned

Supported

*Novell will deliver an implementation of Silverlight on Linux, called Moonlight.

Page 15: Windows Live Technical Development Series   Part 2

Virtual Earth

• Virtual Earth– Hosted, programmable Geographic Information

System– No credentials required for Virtual Earth control

• MapPoint– Suite of products and services for integrating

location-based services– SOAP API developer account available at

https://mappoint-css.live.com/MwsSignUp

Page 16: Windows Live Technical Development Series   Part 2

Virtual Earth Control

• Incredibly robust control for mapping and mashups

• Built-in zooming, panning, etc

• 3D available with ActiveX install

• Supports GeoRSS– Ideal for building overlays

with hover windows

Page 17: Windows Live Technical Development Series   Part 2

Expo

• Marketplace available on live.com– Supports listing and searching just about

everything

• Accessible via HTTP/GET or SOAP API– Register for credentials at

http://expo.live.com/MyAPIKeys.aspx– Both mechanisms return XML to be parsed

Page 18: Windows Live Technical Development Series   Part 2

Summary

• Search• Virtual Earth• Silverlight Streaming• Expo