Category: Windows Live

Getting started with Windows Live Agents

Posted on 4:17pm 7/05/2008 by Bruno Silva in Programming, Software, Web, Windows Live

Windows Live Agents

Recently I’ve been exploring the Windows Live Agents SDK. This framework allows you to develop interactive Windows Live Messenger bots. You may already talked to a messenger bot like encarta@conversagent.com which allows you to search information from Encarta Encyclopedia or if you are Portuguese maybe you use info@destakes.com which gives you news about topics you choose, using data from several news websites.

To start developing your Agent/Bot/Buddy you must have Visual Studio 2005/2008 installed as well as .NET Framework 3.0. More details about requirements can be found in the Installation Requirements web page.

After fulfilling the requirements you can download the Windows Live Agents SDK and install it.

Now you are able to start developing your first agent! Open Visual Studio and open the “New Project” window. There will be a new project template under the “BuddyScript” project type. After choosing the “Windows Live Agent” project template, and typing your project name, you will be prompted for some project settings. You can choose several languages for your Agent and define if it will be able to do some default chatting with users. The only problem I found is that a project created this way is way too complex for a beginner, and if (like me) your target language is not supported or if you want your agent being able just to respond to specific messages, it is pretty difficult to use this template.

After hours trying to find out that was really relevant, I’ve created a Simple Project Template from which I removed a lot of files and settings from the original project. It has only some usage examples in Main.ddl (main BuddyScript file). This project is testable out of the box :)

The examples I left on the file are pretty simple. They cover how to set an expected input and how the bot is supposed to react. It also uses a package that makes available information about the current user, like his user name. I left some comments in the code. There are a lot of possibilities that can be explored. Something I tried already and that I will share in future posts is the usage of data sources like XML, Databases, RSS, etc. If you are curious about BuddyScript capabilities take a look at the BuddyScript Language Reference.

In order to test your agents you must have a license key, which is easy to obtain from within Visual Studio. Check out How to: Install the License Key.

You can test your agents directly in Visual Studio (Menu View > Other Windows > Conversation Window) with the interface showed bellow.

Windows Live Agents - Testing

More information about this kind of testing can be found on the How to: Launch the Agent in the Windows Live Agents IDE article.

Another way of testing your Agent which is much more fun, since you can ask your friends to test it too, is deploying your Agent on the Windows Live Messenger network.

Windows Live Agents - Deploying

Read How to: Launch the Agent in IM Environment to learn how achieve it.

More detailed information can be found in the Windows Live Agents SDK documentation at MSDN.

Next time I will talk about using data sources, background procedure (code that runs detached from user conversations), notifications (scheduling messages) and how to create pro-active agents that starts conversations instead of responding to user requests.

Advertisement in Windows Live Messenger

Posted on 12:48pm 7/02/2008 by Bruno Silva in Microsoft, My Life, Usability, Web, Windows Live

In understand that to make Windows Live Messenger profitable and free to all of us to use it has to have some kind of advertisement system attached to it. Sometimes these ads are useful, since they are different for each country and there are several major brands that use Windows Live Messenger advertisement.

Windows Live Messenger Advertisement

Nevertheless, recently I’ve not been pleased by Messenger advertising. It has been really annoying. Now there are a lot of ads that just pop up out of out our main Messenger window showing some sort of flash animation. Some of them are pretty big and annoying when I trying to reach a contact that is hidden beneath the ad… Most of them disappear when the mouse leave the ad area (it is the minimum that I expect…) but other ads are only disabled by clicking a close button.

Windows Live Messenger Advertisement

I am starting to understand those people that use software that patches Windows Live Messenger to remove all the advertisement. It violates the terms of usage and it is wrong to do it, but this Messenger advertisement “feature” is becoming to invade the user space. Some day in the future maybe I will consider the hypothesis of moving to a IM software like Pidgin (which I like pretty much :) ) that is compatible with MSN protocol.

There is even a portable version just like I love in software).

Joining Windows Live ID and ASP.NET Membership Provider

Posted on 1:28pm 3/08/2008 by Bruno Silva in .NET, ASP.NET, Programming, Windows Live

Windows Live ID - ASP.NET Membership Provider

As you might know, it is possible to use Windows Live ID Web Authentication SDK in your websites as an authentication mechanism. You put an iframe in your homepage, which links to the Windows Live ID sign in page. After a successful authentication the user is redirected back to your website, where you receive the user’s ID. With this ID you can find your user data in your database, and do whatever you need.

Since ASP 2.0, you can use the ASP.NET Membership/Roles Provider as an authentication/authorization mechanism in your websites. You even have controls that make these tasks easy. If you are not familiar with these functionalities take a look at a nice video available in the ASP.NET website: Securing your Web Site with Membership and Login Controls.

Yesterday I started to build a new website, and I wanted to use Windows Live ID as the authentication mechanism. But since I was using an existing website framework that used ASP.NET Membership/Roles Provider not only for authentication but also for authorization purposes, I tried to integrate both. I wanted to eliminate the need for a new user/password for the user to remember, and maintain the benefits of Membership Provider.

You can download the demo website that I wrote which is a simplified version of the website that I am building. It is pretty simple. Do not forget to register you application and change the corresponding parameters in web.config.

The first step is to configure ASP.NET Membership provider. You can use a tool that allows you to add the membership provider tables to your database (C:\Windows\Microsoft.NET\Framework\v2.XXXXXX\aspnet_regsql.exe) or use Web Site > ASP.NET Configuration menu in Visual Studio that creates an SQL Server Express database to store the data.

In your web.config file you must setup the Membership Provider. I’ve done some configuration which allows you to create users using just an user name and a password (eliminating the usual e-mail, question and answer of password recovery, etc). You will be using Forms authentication.

I have a default.aspx page which has an iframe that has a link to Windows Live ID sign in page. When you click the sign in link you are redirected to the sign in page, and the forwarded back to your website, to a authentication handler page named webauth-handler.aspx. This page is part of a sample that comes with Windows Live ID Web Authentication SDK.

Windows Live ID - Sign In

You will have just to add a few lines of code, that maps the Windows Live ID authentication to the Forms authentication of your website. You can see these lines in the demo website.

When you sign in with an account that is not registered in your website, a user account is created (only using the user ID as username and password), and you are redirected to a page where you can edit your profile.

Profile Provider is another great functionality of ASP.NET that allows you to assign custom data to your website users. In web.config you define which properties does a user profile has. Then you can access the Profile object from anywhere in your code, and read/write the current user profile properties. These properties can be changed, and Profile object has a Save method that persists the profile information into the Profile Provider (usually a database).

In default.aspx the current user profile is printed out into the page.

Windows Live SkyDrive

Posted on 8:03pm 2/21/2008 by Bruno Silva in Microsoft, Utilities, Web, Windows Live

Windows Live SkyDrive

Finally it is available! 5 Gb of space available for each user. Secured by an SSL connection. Available on IE and Firefox. Attached to your LiveID account.

Store files for yourself

Using multiple computers? No problem. Store and access your personal files from anywhere online.

Share files with friends

Sharing with friends, co-workers, or family is easy when you all add and update files in a shared folder.

Share files with the world

Some ideas are too good to keep to yourself. Share them in a public folder that only you can update.

More information at skydrive.live.com

Virtual Earth - 3 in 1

Posted on 10:15am 12/27/2007 by Bruno Silva in Microsoft, Programming, Software, Web, Windows Live, XBox 360, XNA

Virtual Earth

In the last few days I’ve been working with theVirtual Earth API in my spare time. I made a demo application of Virtual Earth. In this demo I used a Windows Forms application to wrap a Virtual Earth (VE) map (which is loaded in a HTML page into a WebBrowser control).

In that HTML page I added some Javascript functions that wrap the VE API in some functions which I call via the WebBrowser control. This way I can manipulate the map in Windows Forms. I’ve added support to my XBox 360 GamePad Component. You can use your game pad to pan and zoom in/out in the 2D map. You can also switch between map styles (road,aerial, hybrid, bird’s eye). This is still a developer’s toy, since you need XNA Game Studio 2.0 installed to be able to run this application. Oh, and you also need .NET Framework 3.0.

I was surprised when I found out that the beta 3D view in VE natively supports the XBox 360 controller.

The least but the last feature I added was support for Microsoft Speech. I added a welcome message, and if you say the name of a country (in English) the map moves into that country (or to be more specific, to the country name that the application understood…). I’ve achieved this by loading a XML file, which I found over the web, that contains the name of many countries (not sure if contains them all). After loading this file the code is pretty similar to my previous post about Microsoft Speech.

That’s all! I’ll be pleased to answer some doubts and hear suggestions about this demo.

© Bruno Silva | Powered by Wordpress