.NET Zone is brought to you in partnership with:

I am developer and technology maniac who is working on Microsoft and PHP technologies. I have ASP.NET MVP title and I hold MCAD, MCSD and MCTS certificates. When I have free time I usually play with new technologies, hack something, read books, participate in communities and speak in events. I am also active blogger and my ASP.NET blog is the place you can find some interesting reading about my discoveries and personal thoughts. Gunnar is a DZone MVB and is not an employee of DZone and has posted 142 posts at DZone. You can read more from them at their website. View Full User Profile

Super-Easy Access to Social Data via ASP.NET MVC

  • submit to reddit

I found small library called SocialCounter.NET that is able to display some data from popular social sites. Although it is possible to use widgets offered by social networks there are also scenarios when you don’t want or can’t use these JavaScript based widgets. In this posting I will show you how to use SocialCounter.NET.

Start with downloading SocialCounter.NET. You can also use NuGet package manager to download SocialCounter.NET.

Using SocialCounter.NET is very easy as you can see from this example view:

@using SocialCounter.NET;

     ViewBag.Title = "Home Page";

    Twitter followers: @Counter.GetTwitterFollowersCount("gpeipman")<br />
    Facebook friends: @Counter.GetFacebookFriendsCount("gpeipman")<br />
    Facebook likes: @Counter.GetFacebookLikes("http://www.eindhovenmetalmeeting.nl/")<br />
    Delicious saves count: @Counter.GetDeliciousSaveCount("http://youreffectiveleadership.com/")<br />

SocialCounter.NETAnd the result is shown on image on right.

You can use SocialCounter.NET by example on user profile pages and on your content pages where you want to show how many people have saved current page as bookmark.

SocialCounter.NET supports also LinkedIn, RSS-feeds and Google Plus accounts. In future – I hope – they will add support for more social networks to their library.


Published at DZone with permission of Gunnar Peipman, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)