Share via


Windows Live Messenger + Twitter Addin (with setup and source code)

Twitter is a free social networking and micro-blogging service that allows users to send "updates" (or "tweets" (TW); text-based posts, up to 140 characters long) to the Twitter website. [Source: wikipedia]

Being an user of MSN (ops, Windows Live Messenger) since many years now, I get used to keep my WLM Personal Message (PM)updated.

Now, if we think about the two technologies together, isn’t a tweet kind of a public version of our personal message? Yep smile_omg

Merge

For this reason, I’ve developed with my dear friends Stefano Santoro (Microsoft Student Partner from Italy) and Marco Bodoira (CE Embedded expert at BEPS) an add-in for Windows Live Messenger that keep the personal message of MSN synchronized with your Twitter status. Please note that this add-in is not supported. (More info about support below).

How does the add-in works?

When the add-in is turned on, it will keep your TW on Twitter synchronized with the PM on MSN; in fact your PM on MSN will be sent to TW within the specified polling time.

Addin 

Where can I download the add-in?

You can download the setup file here, or download and view the source code here.

How do I install the add-in?

In order to start the magic synchronization, you need to install the Setup file (download it here). On the first restart of WLM, you will be asked to prompt your Twitter information (obviously your information will be saved and you will not be prompted to insert them again…). The only action required from you is to manually Turn On the add-in.

TurnOn

Why did you developed this add-in?

For fun. smile_regular

To be used. lightbulb

To show some example of interoperability between “everyday application” and web services in the cloud. envelope

The whole communication layer with the Twitter web service uses web services, with the following two functions:

         internal bool SendTwitter(string message)
        {
            if (string.IsNullOrEmpty(message))
                return true;

            string auth = Convert.ToBase64String(Encoding.UTF8.GetBytes(Username + ":" + Password));
            string status = "status=" + HttpUtility.UrlEncode(message, Encoding.UTF8);
            byte[] data = Encoding.ASCII.GetBytes(status);

            try
            {
                HttpWebRequest req = WebRequest.Create(SetStatusUrl) as HttpWebRequest;
                req.Method = "POST";
                req.Headers.Add("Authorization", "Basic " + auth);
                req.ContentType = "application/x-www-form-urlencoded";
                req.ContentLength = data.Length;

                Stream reqStream = req.GetRequestStream();
                reqStream.Write(data, 0, data.Length);
                reqStream.Close();

                return true;
            }
            catch
            {
                return false;
            }
        }

        internal string GetTwitter()
        {
            string auth = Convert.ToBase64String(Encoding.UTF8.GetBytes(Username + ":" + Password));

            try
            {
                HttpWebRequest req = WebRequest.Create(string.Format(GetStatusUrl, Username)) as HttpWebRequest;
                req.Headers.Add("Authorization", "Basic " + auth);
                req.ContentType = "application/x-www-form-urlencoded";

                XmlTextReader reader = new XmlTextReader(req.GetResponse().GetResponseStream());
                string status = string.Empty;
                if (reader.ReadToDescendant("text"))
                    status = reader.ReadString();
                reader.Close();

                return status;
            }
            catch
            {
                return "";
            }
        }

An interesting bit of this project is the setup file, that performs the following operations:

  • Check pre-requisites
  • Deploy assembly and configuration file
  • Register assembly in the GAC
  • Instruct programmatically WLM to run add-ins
  • Instruct programmatically WLM to install our add-in
  • Complete rollback of the installation in case you want to uninstall...

Is the add-in supported?

NO, the add-in is not (and will not be) supported. However we tested it successfully on Windows XP 32bit (English and Italian), Windows Vista 32bit (English and Italian)…with Windows Live Messenger 8.5 and Windows Live Messenger 9.0. Please let us know if you can install it on platforms other than these.

Does the add-in need any 3rd-party components or Plus or will it ask me to pay?

NO, NO, NO. The add-in requires Windows Live Messenger and the .NET Framework 2.0 installed only. If the setup detects that you are missing the .Net Framework, it will download and install it automatically for you.

What are your Twitter account?

Want to know more about Windows Live Platform?

Have a look at those great blogs from colleagues:

Any feedback?

Please feel free to add a comment or a feedback to this post!

Thank you
Happy twittering with MSN,

Giorgio, Marco & Stefano

Technorati Tags: MSN,Windows Live Messenger,Twitter,C#,Addin,Installation

Comments

  • Anonymous
    May 11, 2008
    PingBack from http://www.travel-hilarity.com/airline_travel/?p=4462

  • Anonymous
    May 11, 2008
    Web Clipboard ActiveX for Image Copy/Paste into Web Forms SQLServer SQL Server 2008 Page Compression

  • Anonymous
    May 12, 2008
    very good tool, tested on windows xp, very easy to use and i told my friend in the office about it and kept saying "woww, that what i wanted wahooo, i have now twitter, facebook, windowsliveMessenger and my blog all connected to each other, i completed the circle :)" Thanks man :)

  • Anonymous
    June 01, 2008
    Hi, this is very good, but, what if there are more people using same pc, how are related the actual messenger account, and the twitter account set into WLM? Thanks

  • Anonymous
    June 01, 2008
    Hi Juan, with this release, we can target different instances of MSN (since the binding addin+MSN account is written in a registry key specific for the logged user), but we are storing username/password in the same xml file. If you need to change this behaviour, you could customize the serialization of the username and password, in order to create an unique config file for each msn user... Source code is provided, feel free to customize as you prefer :)

  • Anonymous
    September 19, 2008
    Is it compatible with Windows Live Messenger 2009?

  • Anonymous
    September 19, 2008
    Paulo, if you mean the new Windows Live Messenger Wave3 Beta Release...the answer is no. Unfortunately, as specified in the post, this plugin will not be supported in future version of MSN. Ciao! G.

  • Anonymous
    March 25, 2009
    The comment has been removed

  • Anonymous
    March 25, 2009
    Hi Rogerio, unfortunately this addin is not supported on Live Messanger 2009. Thanks, Giorgio

  • Anonymous
    October 31, 2009
    Great idea however it doesn't work with Windows 7. Hopefully one day as I think this would be a very popular and useful tool!