Loading...
Kenc.Facebook
Kenc.Facebook is a .net library for interacting with the facebook Graph API.
The library aims to have 100% coverage of the regular Graph and Video Graph API.
How to use
Install Nuget:
Install-Package Kenc.Facebook
The .net assembly contains several classes and interfaces - everything is built to be replaceable and unit-testable.
To make users get going fast, I have created a GraphAPIFactory class, which creates everything the user needs to get going.
Let's have a look, at how we can grab certain fields and posts from a Facebook page.
var fields = new[]
{
Fields.id,
Fields.name,
Fields.website,
Fields.description,
Fields.about,
};
var leafs = new Dictionary<string, IEnumerable<Fields>>
{
{ "posts", new [] { Fields.id, Fields.message, Fields.created_time } }
};
var graphApi = GraphAPIFactory.CreateGraphApi("valid facebook token");
var entity = graphApi.Get("pagename", fields, leafs);
Console.WriteLine("Page name: {0}", entity.Name)