BTB025

Developing Interactive Applications Using Windows Live Robots, Activities, And Alerts
Campbell Gunn Program Manager Microsoft Corporation

John Kim Pierre Berkaloff

Agenda
Introduction Activity Applications Alerts Building and Deploying „Bots‟

Windows Live™ Messenger Platform
Build interactive multi-user applications Potential audience of 200 million users Opportunities for business and hobbyist
API access free upon accepting TOU Serve ads and share revenue Purchase advertising Pay for placement

A new twist on Mash-ups
DHTML and AJAX style development Multi-user apps without the pain

Windows Live™ Messenger Applications
Activities, Bots, Alerts

Its all about user interaction and engagement!

Windows Live™ Messenger Applications
Activities, Bots, Alerts

Activity Window

Client to Client data xfer Conversation interaction HTTPS for secure data exchange Mashup style applications (DHTML & AJAX)

Windows Live™ Messenger Applications
Activities, Bots, Alerts

Bot Conversation

Interact via the conversation, user tile, psm Broad, or domain specific interaction Can be combined with Activity apps Built on 3rd party hosting platforms

Windows Live™ Messenger Applications
Activities, Bots, Alerts

Published via RSS feeds Draw users back into Messenger Launch Activities and Bots from toast

What Are MSN Alerts?
A great new way to deliver information to consumers Up to 10x more effective than simple e-mail *
Find where customers are on network, then deliver by
MSN Messenger (Desktop Alert and Tab) MSN Hotmail MSN Mobile*

A great new way to partner with MSN
Drive traffic Reinforce brand

Generate revenues
* Based on 1% average simple email response ** Mobile available in US and Canada only

Windows Live Safety Scanner Activity Application ESPBilly Bot And Activity Application

Activity Applications

Activity Applications
How to Create a Messenger Activity
Multi User Activity
Sample Code

Single User Activity
Sample Code

Debugging an Activity App Demo-Walk through

What Are Activity Apps?
One or two user apps built on the Windows Live™ Messenger communication infrastructure
Connect Peer to Peer or through the Windows Live Cloud Work across firewalls and proxies Run in an IE window attached to the Messenger Conversation window

Can be hosted on the Internet or intranet Interact with
Messenger conversation stream Messenger user Info

Launchable from inside or outside Messenger
Contact based invitation model Launch ability provisioned by Windows Live™

Messenger Activity Platform
Apps can be built using DHTML or ActiveX Development options
ASP.NET, C/C++, C#, Visual Basic, VBScript, JScript, HTML, DHTML, XML, and more…

Great international support!
Windows Live™ Messenger Worldwide Support
25+ languages 45+ Markets

Can be market and/or language specific

Design Considerations
IE 5.01 or greater required Max window size 500 x 500 pixels
Recommended, but now limited

Connection Types
Indirect – via Messenger cloud
195k per minute

Direct – Peer to Peer
Limited by connection bandwidth

Security considerations require that ActiveX apps be certified by Windows Live No adult, gambling or hateful content Application should include a Help link

Messenger Activity Objects
External – Parent object Channel – Client to client communication Error – Error code and data FileInfo – File transfer operations Messenger – Dialer and Options dialogs User – User properties Users Collection – Enumerates user list

Access restricted

Activities Architecture
Multi (Two) User Activity

Servers

Activity Application

Activity Application

Required Definitions
Apps must sync these events
function Channel_OnRemoteAppLoaded() { // The remote application is loaded and ready; start multiplayer } function Channel_OnRemoteAppClosed() { // Remote application is shutting down; game over } function Channel_OnDataReceived() { // Data received from remote app, inspect value of Channel.Data }

function Channel_OnDataError() {
// Error during SendData, may need to retry. } function Channel_OnTypeChanged() { // Inspect Channel.Type for the state of the connection (Direct, Indirect, Disconnected)

}
function Channel_OnAppClose() { // Messenger is shutting down, clean up application }

Provisioning Restricted Functionality
SendIM
Exposes EnterIM & SendIM methods in the Channel object

ReceiveIM
Exposes OnIMReceived event and IM property (ro)

ActiveX
load ActiveX controls in local user security context

EnableIP
Allows access to local & global IP addresses

ReplaceIM
Exposes OnIMReceived event and IM property (rw)

SendFile
Exposes file xfer PEMs in the Channel object

UserProperties
Exposes E-mail and Name in User object

Channel Object
Properties Data
A variant containing the data received from the remote application

Error
An Error object containing data that could not be delivered

FileInfo
A FileInfo object that represents a file being sent or received. Requires SendFile permission

Type
A ConnectionType value representing the type of connection between peers

IM (read-only)
String containing the instant message that was received and displayed. Requires ReceiveIM permission

IM (read-write)
String containing the instant message that was received. The message can be changed before it is displayed. Requires ReplaceIM permission

Use Of XMLHTTP
Given to you with IE 7.0
Windows.External.XMLHTTP

Allowed with IE 6.0
ActiveX control allowed to load CreateObject(XMLHTTP);

Pull in dynamic AJAX content into your Application without IFrame manipulation Support for XMLHTTP
Get it with Windows Live Messenger Version 8.0 MSN Messenger 7.5 and lower needs IE 7.0

Building An Activity Application

What Is Provisioning?
Two step process
Enabling you to test your application Making your app available to Windows Live Messenger users

Why is provisioning required for Windows Live Messenger Activities.
Verify apps use the Activity API properly Verify app compliance with Terms of Use Give Messenger users a great experience

Provisioning Settings
Creating the msgrp2p.xml file
Enables Messenger to load an unprovisioned application for testing Same XML as used by Windows Live Servers Adds item to the “Actions” menu
Start (Name) (Name) defined by the Name element

Needed on both machines for testing

Creating msgrp2p.xml
Important values to set
EntryID = „7‟ for test apps Category = ‟50‟ for test apps Sequence = ‟10‟ for testing Name = String displayed in Actions menu URL = HTTP address of Activity web page Type
App=application Dir=game

Height
max=500

Width
max=500

Launching An Activity App
Launch from Actions menu
Start (App Name) Works prior to provisioning

Launching From a Web Page
Only works after provisioning Invoke Windows Live™ Messenger by calling:
http://messenger.msn.com/Resource/games.aspx?appID=APPID

The APPID value
Uniquely represents your Activity app Assigned by Windows Live™ during provisioning

Debugging Setup
Enable debugging in IE Advanced Tab
Uncheck “Disable script debugging (IE)” Uncheck “Disable script debugging (Other)”

Place app and resources on web server
Multi-user apps require 2 machines to have 2 Messenger logins Edit msgrp2p.xml to reference web server

Place msgrp2p.xml on test machines
C:\Program Files\MSN Messenger

Debugging Tips And Tricks
Use VisualStudio 2005.net Have the debugger break post the point where you want to check variables and walk backwards Check the P2P channel occasionally in application JavaScript: Use the “debugger” keyword to start script debugging Place “debugger” keyword at top of page
Enables vars in Immediate window, Enables setting breakpoints

Use Alerts often Use Channel.SendIM to output debugging text to conversation window Reopen conversation to reload msgrp2p.xml App is reloaded on every invocation

Provisioning, Debugging And running Application

Alerts

What Are MSN Alerts?
AnyKiller Real-Time Info Delivery A FREE Communications Platform ! Kind of RSS-Triggered Information

Sports

Job hunting

Products

Travel

Blogs

News

How Do Users Sign Up?

100% User Opt-In

Delivery to:

Desktop Email SMS

Using PRESENCE, Our Alerts Platform Automatically Finds User With RSS-Triggered Information

… Which DRIVES Traffic To Your Platform

… And Offers Stunning Click-Thru PERFORMANCE To Almost 200 Million Messenger Users
L‟Oreal 24% and 35% (Beauty Alerts)

MSN Autos 18% (Detroit Auto Show) ILoveMessenger 23% (Contest) Messenger Beta 37% (Upgrade info)

MSN Alerts Manager
Online App To Manage It All

Customize

Create

Report

MSN Alerts Platform Partners Include…
Windows Live Expo MSNBC FOX Sports MSN Spaces (Australia) Feedburner MSN Travel Money Central Etc.

Best Part
ZERO deployment time

MSN Alerts Platform is Free to Developers and Users (Ad Supported)

Please visit http://SignUp.Alerts.MSN.com or BizDesk@Microsoft.com for more information

Building And Deploying Windows Live Robots
John Kim Pierre Berkaloff

IM Robots Are Not Web Sites
Conversational nature Rate of growth Traffic patterns
Incoming users ramp-up rates at peak times

Responsiveness expectations from users Off the shelf Web serving technology is not practical in this environment.
Web serving bandwidth constrained IM Bots are CPU constrained/OS limitations constrained

Case Study
Smarter Child
Launched 4 months ago on MSN
300 million+ queries per month 3 million + unique messenger users Traffic at peak times 300 queries per sec

never promoted or advertised anywhere viral growth (entirely word of mouth)
smarterchild@hotmail.com

What You Need To Build Bots
Natural Language Engine Conversational System User Profile Messenger network faceless client supporting latest large range of features
All these should be highly scalable and cost effective

What You Need
Natural language
Comprehensive natural language processing engine
Highly optimized for IM scale traffic Efficient natural language definition syntax Support for both Static , dynamic (data-driven) and procedural lexical items

Automatic binding of user input data to variables Dialog handling
Ability to handle complex conversational dialogs

Context awareness
Giving preference to the current conversation subject Anaphora ( Ex: Can you show it to me ?}

Ambiguity resolution
recognizes ambiguous queries Prompts user to clarify intent

Language Libraries
Language Parsing Rules Lexicons Industry specific Extensions

Spell Correction

What You Need
Conversational Centric platform
Adaptive output IM centric User Profile Management Logging Usage Reporting Quality Analysis

What You Need
Messenger Features Support
Display Pictures Emoticons Dynamic Display Pictures Pretty Name Personal Messages Backgrounds MSN Activities
Ability to invite Accept invitation Transfer information between the bot and the user Page driving

Building An Agent
Adding Basic Natural Language Starting the Agent Data Feed Binding User Input Binding Adding Conversational Structure Adding Activity Support

Adding Basic Natural Language And Conversation Structure
? Hello. - Hi ! Nice to see you. ? I am lost ? Help - I am here to get you to discover MSN Music.

In Action
? Hello. - Hi ! Nice to see you. ? I am lost ? Help - I am here to get you to discover MSN Music.

In Action
? Hello. - Hi ! Nice to see you. ? I am lost ? Help - I am here to get you to discover MSN Music

In Action
? Hello. - Hi ! Nice to see you. ? I am lost ? Help - I am here to get you to discover MSN Music.

In Action
? Hello. - Hi ! Nice to see you. ? I am lost ? Help - I am here to get you to discover MSN Music.

In Action
? Hello. - Hi ! Nice to see you. ? I am lost ? Help - I am here to get you to discover MSN Music.

In Action
? Hello. - Hi ! Nice to see you. ? I am lost ? Help - I am here to get you to discover MSN Music.

Data Binding
5 Line binding to a RSS feed:
datasource GetMSNMusicFeed() => Title,Description,Link http {timeout="20"} http://music.msn.com/services/rss.aspx?uid=00000002-0000-0000-0000000000000000 simple xml rss channel {loop=content} item {loop=content} title description link

Hooking it up to a reference request
? Show me the top 10 TITLE, DESCRIPTION,LINK = GetMSNMusicFeed() show 10 * Here is the Top 10: - TITLE * more to see more items.

In Action (Data Feed)
? Show me the top 10 TITLE, DESCRIPTION,LINK = GetMSNMusicFeed() show 10 * Here is the Top 10: - TITLE * more to see more items.

In Action (Data Feed)
? Show me the top 10 TITLE, DESCRIPTION,LINK = GetMSNMusicFeed() show 10 * Here is the Top 10: - TITLE * more to see more items.

User Input Binding
subpattern anArtist + eminem + shakira ? Downloads for ARTIST=anArtist - Here are the downloads available for ARTIST

In Action (User Input Binding)
subpattern anArtist + eminem + shakira ? Downloads for ARTIST=anArtist - Here are the downloads available for ARTIST

In Action (User Input Binding)
subpattern anArtist + eminem + shakira ? Downloads for ARTIST=anArtist - Here are the downloads available for ARTIST

In Action (User Input Binding)
subpattern anArtist + eminem + shakira ? Downloads for ARTIST=anArtist - Here are the downloads available for ARTIST

In Action (User Input Binding)
subpattern anArtist + eminem + shakira ? Downloads for ARTIST=anArtist - Here are the downloads available for ARTIST

In Action (User Input Binding)
subpattern anArtist + eminem + shakira ? Downloads for ARTIST=anArtist - Here are the downloads available for ARTIST

In Action (User Input Binding)
subpattern anArtist + eminem + shakira ? Downloads for ARTIST=anArtist - Here are the downloads available for ARTIST

Adding Conversational Structure
Dialogs
? What is the number 1 song? call ShowNumber1Song() - Do you want me to play it for you? ? Yes
- call DoPlayMusic(1)

? No - Ok. What would you like to do then?

In Action (Dialogs)
? What is the number 1 song? call ShowNumber1Song() - Do you want me to play it for you? ? Yes - call DoPlayMusic(1) ? No - Ok. What would you like to do then?

In Action (Dialogs)
? What is the number 1 song? call ShowNumber1Song() - Do you want me to play it for you? ? Yes - call DoPlayMusic(1) ? No - Ok. What would you like to do then?

In Action (Dialogs)
? What is the number 1 song? call ShowNumber1Song() - Do you want me to play it for you? ? Yes - call DoPlayMusic(1) ? No - Ok. What would you like to do then?

In Action (Dialogs)
? What is the number 1 song? call ShowNumber1Song() - Do you want me to play it for you? ? Yes - call DoPlayMusic(1) ? No - Ok. What would you like to do then?

Adding Activity Support
Defining which activity to use
function overrides MSNSLPGetAgentMainP4ApplicationName() return “MSNMusic" function overrides MSNSLPGetAgentMainP4ApplicationId() return "99991046" // Application ID

Inviting the user
? Invite me again. ? Can you reopen the window? ? Invite me!

call MSNSLPSendInvitationToOpenMainP4Application()

Sending Data to the Activity
Procedure ShowMusicLink(LINK) REQUEST = StringConcat(REQUEST, "url=", LINK) call MSNSLPSendData(REQUEST)

In Action (Activity)

In Action (Activity)

In Action (Activity)

In Action (Activity)

In Action (Activity)

Live Bot Content Management
Natural language and conversation structure we have built can be edited/approved and published live

Live Editing
Reference questions and content

Deployment
Develop for free - pay to deploy model Develop and Test on your Developer edition When you want to deploy at scale
Buy a Server license

Or
Use Conversagent hosting services

Final Thoughts
SDK Freely available 6 months up to 50,000 sessions a month Download available at:
http://buddyscript.conversagent.com

Contact us at:
mix06@conversagent.com

Developer Resources
Windows Live™ Messenger Dev Center on MSDN
http://msdn.microsoft.com/msn/msnmessenger/ Activity API Download

Windows Live™ Messenger Discussion Forum on MSDN
http://forums.microsoft.com/msdn/showforum.aspx?forumid =112&siteid=1

Windows Live™ Messenger Team Space
http://spaces.msn.com/messengersays/PersonalSpace.aspx

Windows Live™ Alerts Signup
http://signup.alerts.msn.com

Windows Live™ Business Questions?
E-mail: bizdesk@microsoft.com

© 2006 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.