Blog 4 Jordan Day

Visitor of the day


  • You
    from

Brag Stats

  • Comments:25,004
  • Articles:2,000
  • Article Hits:12,459,805
  • Unique Visitors:2,000,438
  • Rss Subscribers:3,052
  • Comment Subscribers:2,530
  • Spammers:136,315
  • Generated :757,671 spams
  • Monitoring:3,942,477 spam IPs
Powered by Qwaider Shield

Recent Comments

Check out the latest pictures on Sweetestmemories

« Shame on you Jordan planet, Shame on youRanting and rambling about ranting and rambling »

Add gravatar to your ASP site


    • Currently 4.6/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5

    Rated 4.6/5 stars (249 votes cast) Thanks for your vote!

    Some great guy once said, if you solve a tough problem, Blog it. It will help the next guy struggling with it. Since this got me scratching my head for couple of hours, I decided to spare the next guy struggling with it.

    The reason I'm doing this is simple, to the best of my knowledge, no one has done it for ASP.

    So ... lets start at the top.... .What is gravatar? From their website http://www.gravatar.com/, I got the following explanation

    What is a gravatar?

    A gravatar, or globally recognized avatar, is quite simply an 8080 pixel avatar image that follows you from weblog to weblog appearing beside your name when you comment on gravatar enabled sites. Avatars help identify your posts on web forums, so why not on weblogs?

    Think of gravatar.com as a dictionary that associates email addresses and avatar images. When you leave a comment on a weblog and provide your email address, the weblog can use your email address to look up your avatar. Since the dictionary is available to anyone, a single avatar image can represent you across many different weblogs.

     

    Now also from their site, in the FAQ section, they state that you will need to send them the email address of the user to receive their Gravatar image. Which poses a serious problem: How do you do that, without getting people spammed senseless? The answer was simple enough. Use a one way hash (in their case MD5) to generate the equivalent of the Email address.

    Now I don't want to get into the nitty gritty details of MD5 (you can read it at the IETF website here) but it provides "good enough" uniqueness for hashes generated with it. It's also one way, so there is no [easy] way to get the email back

    To construct your img tag, you will need to format the request as follows:

    First send the request to: http://www.gravatar.com/avatar.php? with the email hash to follow in the format: Gravatar_ID=(Email Hash). An optional Rating can be added to make sure you don't end up with XXX gravatars on your family-only site. Therefore, the optional rating=.

    Additional options: Default, Size, & border. Some additional conveniences to allow you to customize it to your liking.

    Now the million dollar question...The MD5 hash is a bit complex to generate, so How can I do it?

    I started to write my own implementation when I stumbled over a very nice little implementation that is available in VBS and Javascript. All you need to do is include it in your ASP and you get a nice MD5 hash, you can get it here http://www.frez.co.uk/freecode.htm#md5 (I have also copied it to my server in case that site is no longer available, you can get it here: http://blog.sweetestmemories.com/media/md5.zip

    So in your ASP just add [--!#include virtual="md5"--] and in your code just use the function MD5() to return the MD5 hash of the email (example: [img src="http://www.gravatar.com/avatar.php?GravatarID=[%=md5(username%]....etc) (remember to change [ and ] and swap them with < and > respectively

    And that's boys and girls how you can have it on your ASP site, Enjoy

    Other Memories Documented on May 28
    « Shame on you Jordan planet, Shame on youRanting and rambling about ranting and rambling »

    Memories....

    • #1
    • 7usam
    • Windows Internet Explorer
    • Said
    • On: 5/30/2006 3:32:40 PM
    I am a PHP fan but its ok to see what ASP can do
    This site, is 100% ASP, it has served me well.
    I wish PHP was there a few years back when I was 100% Unix ;)
    Hey Qwaider,

    this semester i was introduced to Linux, I did some C/C++ on linux, using pipes and i solved some Assignments on the "NachOS"...

    so can you tell me what this Linux can do for me as a technical in the future ??

    or can you recommend me certain topics that I could learn of linux??

    im still a beginner...
    You know, I think Jad Madi might be a better guy advocating Linux, I'm a 100% Windows ;-). Open source hypes don't fool me Laughing

    But, C/C++/C# are portable you can have good experiences in those. Focus on data structures and algorithms of course, logic design and analysis are very important and microprocessors and computer architecture are a must. And finally Software engineering principles. That's what I can think of now, I'll let you know when I remember. I'm excited, I'm going to watch the Omen :D

    Thanks Qwaider,

    I've taken more that one course on each of the subjects u mentioned above, and I worked many real time projects on these subjects..I think I'll ask Jadmadi about the linux issue
    I would say, do As much algorithms as you can, advanced algo, applied algo .. 7asheesh algo :) You can never have enough algorithms
    Algo un problema seor?

    Aww bil3araby: Bee (not me :P) maskhal?
    KBB, you wanna say, you didn't like 7asheesh algo!!? come on
    • #9
    • Sterli
    • Windows Internet Explorer
    • Said
    • On: 7/26/2006 11:55:12 AM
    Good Job
    You too can have your Memories Documented

    Country:

    HTML has been disabled but if you wish to add any hyprlinks or text formating you can use any of the following codes: [B]bold text[/B], [I]italic text[/I], [U]underlined text[/U], [S]strike through text[/S], [URL]http://www.yourlink.com[/URL], [URL=http//www.yourlink.com]your text[/URL]

    Whisper (your comment will not be displayed)

    Please refer to Commenting policy


    Notify me of follow-up comments by email
    « Shame on you Jordan planet, Shame on youRanting and rambling about ranting and rambling »
    Read by:
  • Guests(3)-
  • |
  • Guests(2)-
  • |
  • Guest-
  • |
  • Guest-
  • |
  • Guests(14)-
  • |
  • Penis Enlargement-
  • |
  • Penis Enlargement Pills-
  • |
  • Weight Loss Pills-
  • |
  • Guest-
  • |
  • Theodore-
  • |
  • Guests(136)-
  • |
  • Guests(93)-
  • |
  • Guests(344)-
  • |
  • Guests(3)-
  • |
  • Guests(25)-
  • |
  • Guests(315)-
  • |
  • Guests(3)-
  • |
  • Guest-
  • |
  • Guests(2)-
  • |
  • Guests(9)-
  • |
  • Guests(9)-
  • |
  • Guests(184)-
  • |
  • Guest-
  • |
  • Guests(68)-
  • |
  • Guests(12)-
  • |
  • Guests(27)-
  • |
  • Guest-
  • |
  • Guests(11)-
  • |
  • Guests(3)-
  • |
  • Guests(9)-
  • |
  • Guests(5)-
  • |
  • Guests(15)-
  • |
  • Guest-
  • |
  • Lost Within-
  • |
  • Guests(21)-
  • |
  • Guests(13)-
  • |
  • Guests(4)-
  • |
  • Guests(15)-
  • |
  • Guests(132)-
  • |
  • Guests(4)-
  • |
  • Maximo-
  • |
  • Guests(24)-
  • |
  • Guests(4)-
  • |
  • Guest-
  • |
  • Guest-
  • |
  • Guests(268)-
  • |
  • Guests(9)-
  • |
  • Guest-
  • |
  • Guests(3)-
  • |
  • Guests(17)-
  • |
  • Guests(2)-
  • |
  • Guests(3)-
  • |
  • Guests(196)-
  • |
  • Guests(15)-
  • |
  • Guests(262)-
  • |
  • Guest-
  • |
  • Guests(2)-
  • |
  • Guests(18)-
  • |
  • Guests(2)-
  • |
  • Guests(19)-
  • |
  • Guests(14)-
  • |
  • Guests(202)-
  • |
  • Guests(6775)-
  • |
  • hamede-
  • |
  • Maioush-
  • |
  • Mohanned-
  • |
  • Guests(3)-
  • |
  • Guests(5)-
  • |
  • Guests(2)-
  • |
  • Guests(3)-