Home > Uncategorized > AvatarAPI .com now includes @DandyID and #Flickr

AvatarAPI .com now includes @DandyID and #Flickr

AvatarAPI

Want to pre-fill a contact form with the full name of the person contacting you?, got a database of email addresses that don’t include names? AvatarAPI.com solves that for you!

It’s even fun if you just want to put a face to that last email you were sent. Try it out! 🙂

We’ve now added extra sources, outside of Google, including Flickr and DandyID. Both significantly smaller than Google, but every little helps.

The DandyID API is quite niche, so I thought I’d share the c# implementation here:

var strUrl = “http://www.dandyId.org/api/return_profile/{APIKEY}/{0}/public”;
strUrl = string.Format(strUrl, email);
var wc = new WebClient { Encoding = System.Text.Encoding.UTF8 };
var strXml = wc.DownloadString(strUrl);
if (!strXml.Contains(“userId”)) throw new Exception(“DandyId lookup failed”);
var xmlDoc = new XmlDocument();
xmlDoc.LoadXml(strXml);
var strRealName = xmlDoc.SelectSingleNode(“userProfile/firstName”).InnerText;
strRealName += ” ” + xmlDoc.SelectSingleNode(“userProfile/lastName”).InnerText;
var strId = xmlDoc.SelectSingleNode(“userProfile/userId”).InnerText;
var Image = “http://www.dandyid.org/beta/avatar_image/” + strId;

 

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: