Home  |  FAQ  |  About  |  Contact  |  View Source   
 
SEARCH:
 
BROWSE:
    My Hood
Edit My Info
View Events
Read Tutorials
Training Modules
View Presentations
Download Tools
Scan News
Get Jobs
Message Forums
School Forums
Member Directory
   
CONTRIBUTE:
    Sign me up!
Post an Event
Submit Tutorials
Upload Tools
Link News
Post Jobs
   
   
Home >  Messages >  ASP.NET >  Messenger Status Displayed on Web Page
Add to MyHood

Author
Subject:  Messenger Status Displayed on Web Page
 

Subscribe to this thread

Greg  McMurray

6/10/2002 4:25:13 PM Not rated

I could use some help with the code to display the status of a users status on messenger. I am sure that this requires them to use passport on the website to login but I am just not really sure where to begin looking. Any tips/links/examples/ideas?

Thanks


[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Andrew  Ma

6/10/2002 5:28:07 PM Avg. Rating: 3 by 1 Users

I'm not sure if this can be done. I think we were looking into doing this for devhood a while ago.... at that time, MS told us it couldn't be done... since then, they've released APIs (link: ) which might do what you're looking for. Try that and see what happens.

I'm not sure how hotmail does it.....



[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Greg  McMurray

6/11/2002 7:31:49 PM Not rated

I have spent the last two days exploring the API and writing some sample code, and surprisingly most of the Messenger API is exposed the end user... which is really great. Unfortunately, this is uses the local copy on the machine, which means if I ran it on a server I would have to load messenger and make sure it is constantly signed into the service. I was thinking about trying to wrap the Messenger exe (where the COM objects are stored, msmsgs.exe for those that are curious). The web site could then host the dll and make it part of the code that the user downloads and runs, which reports the status back to the server... but that seems somewhat unrealistic (and invasive).

I am about 99% convinced that Passport has the information available somehow, but I haven't had a chance to explore the passport stuff at all. Hopefully I will be able to post a tutorial on what I have found soon.


[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Ammon  Beckstrom

6/12/2002 9:39:55 AM Avg. Rating: 1 by 1 Users

I'm not sure, but I think that Gotdotnet site does exactly what you're looking for. You might contact their admin to find out what they did and how they did it.



[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Greg  McMurray

6/18/2002 12:41:07 PM Not rated

I looked around on the gotdotnet site... and never saw anything about what you mentioned - do you have a link?


[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Ammon  Beckstrom

6/18/2002 4:34:29 PM Not rated

You need to register with the site first. After that navigate around the site. Go to your university's "home page" and on the right hand side you'll a box that says "classmates online." You'll show up here and so will anyone else from your school that's currently logged on to the site. Additionally, you can check the status of individual users by going to their personal profile/page.



[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Andrew  Ma

6/21/2002 11:39:38 PM Not rated

Ammon, I think Greg is looking for MSN Messenger status, not the GotDotNet Online Status in the personal profiles. Like the ones in hotmail or on the msn page.


[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Heath  Stewart

6/27/2002 11:08:42 AM Not rated

They do it using client-side scripting. MSN / Windows Messenger exposes a script interface that you can use for basic functionality (actually seems pretty unexploitable). It uses your instance of Messenger; so, of course, you must be signed in for it to work...or at least having running. I haven't tested this yet, though I've spent some time playing around with the scripting interfaces (for fun).



[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Heath  Stewart

6/27/2002 12:14:44 PM Not rated

Here's a snippet of code you can use in Excel that shows you essentially what to do:
Public Sub GetBuddies()
    Dim msgr As New MessengerAPI.Messenger
    Dim groups As IMessengerGroups
    Dim group As IMessengerGroup
    Dim contacts As IMessengerContacts
    Dim contact As IMessengerContact
    Dim I As Integer
    Dim J As Integer
    
    I = 1
    J = 1
    
    Set groups = msgr.MyGroups
    For Each group In groups
        Sheet1.Cells(I, 1) = group.Name
        Set contacts = group.contacts
        J = I + 1
        For Each contact In contacts
            Sheet1.Cells(J, 2) = contact.FriendlyName
            Sheet1.Cells(J, 3) = contact.SigninName
            Sheet1.Cells(J, 4) = GetStatus(contact.Status)
            J = J + 1
        Next
        I = J
    Next
End Sub

Public Function GetStatus(I As Integer) As String
    Dim str As String
    Select Case I
        Case 1
            str = "Offline"
        Case 2
            str = "Online"
        Case 6
            str = "Invisible"
        Case 10
            str = "Busy"
        Case 14
            str = "Be Right Back"
        Case 18
            str = "Idle"
        Case 34
            str = "Away"
        Case 50
            str = "On the Phone"
        Case 66
            str = "Out to Lunch"
        Case Else
            str = "Unknown"
    End Select
    
    GetStatus = str
End Function

However, if you try in a web page to instantiate the MessengerAPI.Messenger (or even Messenger.MsgrObject) with "var msgr = new ActiveXObject(...)" (JScript) or "msgr = CreateObject(...)" (VBScript), it won't work. Upon looking at Hotmail's JScript source file (, it that still valid), they actually use the CLSID in an <object/> tag and access methods on that. I'm not sure why that's need (doesn't seem to be a security issue), but perhaps Messenger's Automation API is flawed.

Hopefully this code block and JScript source link give you a starting point, though. It's very easy to do, I just didn't have time to do an HTML script block (autocompletion is nice, ain't it? :-)

PS: There are a few more status messeges possible, but they are all link-specific stuff so I just encapsulated them under unknown. Feel free to specify more text or replace the text with <img/> text to write to an HTML page via scripting.


[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Heath  Stewart

6/27/2002 12:51:31 PM Not rated

I'm going to go ahead and write a tutorial on this (and actually do it in HTML). Depending on the speed the site admins get it posted, I'll post the link here. It shouldn't take me long to write and I need a break from work.



[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Heath  Stewart

6/27/2002 11:12:03 PM Not rated

The tutorial is up and posted here: http://www.devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=478. Unfortunately, I got hasty and didn't test everything.

If you're trying to use the automation interface to retreive names and email addresses, you can't. This was disabled to protect them during that recent Messenger virus. However, you can still enumerate a collection of users and get their status using user.Status. At any rate, this thread was about displaying a user's status from an aparent list that is already present somewhere. You can use the email address as a parameter of the groups.Item() method, rather than an integer. This will get the specific user and let you use user.Status.

Sorry about that.


[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Bryant  Likes

6/28/2002 6:38:52 PM Not rated

For anyone who is working on this, I found a website that has some pretty good code for adding messenger contacts to your website.



He's escaped his script so that it isn't readable, however, it is very easy to unescape the code to read it.






[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Heath  Stewart

7/8/2002 1:08:11 AM Not rated

Why use some obfuscated code when you have no idea of how it works when you have a completely open solution to use. To be honest, his worked like crap and the automation interfaces for all this stuff is simple. My example - trimmed down with just the status of a user because of the security restriction - is not difficult and doesn't nothing different than his (I checked the source).

Basically, what I'm saying is that you don't need an entire "library" (rather, overly-long script file) to display the status, only about 5 lines of code.


[Top]  [Bottom]  [Listen]  [Edit]  [Reply

James  Dvorak

7/15/2002 10:26:25 PM Not rated

I tried this script. I could never get it to "sign-in." It kept saying that it could not retrieve my contact list and that I should sign in. Any thoughts?



[Top]  [Bottom]  [Listen]  [Edit]  [Reply

Heath  Stewart

7/16/2002 9:24:06 AM Not rated

Is Windows Messenger running? Make sure you have the most recent version, too. Messenger didn't always have an exposed API. Just go to .


[Top]  [Bottom]  [Listen]  [Edit]  [Reply

| | Last

Subscribe to this thread
Copyright © 2001 DevHood® All Rights Reserved