Live Messenger API Status Icons

by Patrice 10/13/2008 10:43:21 PM

I just finished working on a small task where I wanted to use Live Messenger API in a web page (this allows the user to contact you using Messenger without having Messenger installed on his machine and having your contact set in it).  A friend of mine just did this for his business web site and I found it very useful. I decided to try it myself.

Since my friend has already done this, he guided me directly where I needed to go to learn about the API. After 10 minutes, it was done.  Basically, you just have to paste this (replace 1111111111111 by your user ID):

<a target="_blank" href="http://settings.messenger.live.com/Conversation/IMMe.aspx?
			invitee=1111111111111@apps.messenger.live.com&mkt=en-US">
    <img style="border-style:none;" src="http://messenger.services.live.com/users/1111111111111@
			apps.messenger.live.com/presenceimage?mkt=en-US" />
</a>

...and it returns this series of icons:

, , etc   ....they are small, just 16x16 and not "clean".

So what can I  do? After investigating, I found that I can get the status by two ways (1111111111111 is your user ID):

1- http://messenger.services.live.com/users/1111111111111@apps.messenger.live.com/presenceimage?mkt=en-US

...that will redirect to the status gif image.

2 - http://messenger.services.live.com/users/1111111111111@apps.messenger.live.com/presence?mkt=en-US

...that will return the status information in JSON format.

One thing I didn't want is use JavaScript. Obviously, if that wouldn't have been the case, JSON would have been the best choice here and easily implemented.

So I had to do the job from the server. I was looking for the easiest way so I just called ".../presenceimage?", using HttpWebRequest and just replaced "live.com" link by my server path... easy!

using (WebResponse response = request.GetResponse())
{
    string msnpath = response.ResponseUri.AbsolutePath;
    localImg += msnpath.Substring(msnpath.LastIndexOf("/") + 1);
}

Note that I don't download the image by calling GetResponseStream.

So by replacing the path, I obviously need to have the replacing image on my server. For that, I Googled a bit and found two set of icons that look much better. MSN Crystal Icons and Messenger Icon Pack... Just use your favorite image editor to resize then and/or change the format.

While I was there, I said "Well, why not a custom control?" To implement this I just rendered the a and img elements in a WebControl ... just few lines... look at the code if you are interested...  In the ASPX, it looks like this:

<lfdx:MSNMessenger uid="8a69c004ce9860b4" cssclass="wt" serverimgpath="images/" runat="server" />
  • uid is the Messenger user Id
  • cssclass class applied to a element
  • serverimgpath is the location of your custom images

Download the project here. Note that I have included the "Messenger Icon Pack" that I have resized to 30x30 gif images.

Nothing complex here just a fun project!

 

Illustrator Live Trace and Live Paint... cool!

by Patrice 9/20/2008 1:57:55 AM

Alright, again, I'm a developer, not a designer... but I like the design related stuffs. See the dumb monkey face on the right side? Well, I just drew it quickly, scanned it in Photoshop and set it up here to replace the default BlogEngine.NET avatar when I started this blog.

Two weeks ago I got Illustrator CS3 (I know, I know, CS4 is coming soon...), so I experimented with it, obviously just the basic stuffs following tutorials.

Last weekend I needed some "original" icons and I didn't have any #%$ inspiration... So I took my pencil and draw things on a piece of paper... "hmm, that looks good!"... So what damn? Am I gonna scan this in Photoshop and try to apply colors...again? I have already tried this many times in the past without success... not even close to be able to use it on a web project.

After browsing Internet on "techniques" on how I could do this, I felt on this Using Adobe Illustrator CS2’s Live Trace tutorial (I didn't even know this was part of CS2)... Well, that seems easy!... the first thing I have tried is to use my own monkey... I got back my old sketch, traced it back a bit darker and scanned it again in Photoshop

Then, following the tutorial and playing with the "Live Trace" properties, I got a nice "vectorialized" monkey... After enabling "Live Paint" and applying two "Live Paint Bucket" on it, I got this

Alright, alright, it's not a "finished" professional image but it just took me few minutes...

Here is another quick sketch I did of a pair of pliers that were lying on the table....

I'm sure designers that read this think that "Live Paint" feature is for amateurs... I give that to you! ha ha ha ha... That's probably like "wizards" or "drag and drop controls" features in Visual Studio... For me, this is like "well, you don't know how it works, so use it... but you won't be able to dig further down in the code because you won't understand a &%*@ thing of what it produces..."

Graphic design from a novice

by Patrice 8/7/2008 1:12:33 PM

Ok, I'm a developer, not a designer. I like drawing, painting and I've always liked designing small items for my web development like buttons, backgrounds, logos, etc. To do this, I used to use Photoshop. I cannot say I'm a "pro" but I can certainly be efficient with those small tasks.

I have switched to Illustrator six months ago. I really like it. The fact that you can resize the items without loosing quality...Wow! How many times have I cursed about this because I haven't started my "button" the right size and had to resize it from Photoshop with crappy results?... So, six months ago I was trying to create a favicon in Photoshop...aarrggg, I'm sure there is a technique but I haven't found it!!! That's where I discovered Illustrator while reading an article that was talking about it. Obviously, the switch was not easy... I bought two training DVDs I finally managed to convert (convert as in "redoing it from scratch") my latest projects in Illustrator.

I really like prototyping my web layout in Illustrator. At least the rounded boxes keep their corner sizes... Something I'm not good at is to "when to stop" designing (since it's more a hobby then a job with deadlines)... I add and add and delete and add... and then realize that the one I did two hours ago was probably the best one... but I don't have it anymore.

So I have decided to take a copy of my AI file every time I'm satisfied with a design and then keep working on the master file. That works perfectly for me! I also export each copy into PDF. It's easier to present or review the layouts. While I was there, I've develop a small tool using PDFSharp library. It merges all my PDF files into a single file and creates "bookmarks" on the left side panel... Really nice for picking up the best design!

I wonder what the experimented (professional) designers do?

 

Update 1: Someone wrote me that in Acrobat 9.0 Extended, there is a way to create a "portfolio" into your PDF file that gives a really nice "presentation" media...

Update 2: Wow! From the video on Adobe web site, it looks very powerful (even PDF merger included)... I'll take a look with the trial version.

Powered by BlogEngine.NET 1.3.1.0

LFDX Software Inc.

About the author

P. Lafond Patrice Lafond
(and yes, it's Mr!)
Software Engineer
French Canadian expat in Bermuda for over 7 years.
flag QC  flag BDA

E-mail me Send mail

Calendar

<<  January 2009  >>
MoTuWeThFrSaSu
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Pages

    Recent comments

    Authors

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2009

    Sign in