Social Shares is a .net library to get an url's share count most popular 10 social network services.
To install Social Shares, run the following command in the Package Manager Console
PM> Install-Package SocialShares
or Download Project and add reference SocialShares.dll on your project.
You must add Json.net(v 6.0 or Higher) references on your project
To install Json.NET, run the following command in the Package Manager Console
Install-Package Package Newtonsoft.Json
if you've already instaled (lower than 6.0) run this. command.
Update-Package Newtonsoft.Json
Get single service result
var shareResult = Facebook.GetShares(url);
string result = String.Format("Your Link {0} , published {1} times on {2}", shareResult.url, shareResult.count, shareResult.SocialNetwork);
Get multiple service result
List socialNetworks = new List();
socialNetworks.Add(SocialNetworks.Facebook);
socialNetworks.Add(SocialNetworks.Twitter);
socialNetworks.Add(SocialNetworks.Vk);
SocialShare s = new SocialShare();
var results= s.GetUrlsShares(url,socialNetworks);
foreach (var item in results)
{
string result = String.Format("Your Link {0} , published {1} times on {2}", item.url, item.count, item.SocialNetwork);
}
Get All Result
SocialShare s = new SocialShare();
var results= s.GetAll(url);
foreach (var item in results)
{
string result = String.Format("Your Link {0} , published {1} times on {2}", item.url, item.count, item.SocialNetwork);
}
Keep Development Alive PayPal cagri058@hotmail.com