FBCE Docs
Search…
Sample API Usage
You can reference FBCE library (project) to your own project to use existing APIs. The API usage is very straightforward and easy to use!
1
ILoginApi login = new LoginApi(() => new FacebookBrowser("/your/chrome/path"));
2
ICommentApi comment = new CommentApi();
3
4
// Get Facebook cookie header
5
var cookie = await login.LoginAsync();
6
7
// Get Facebook comments
8
var logger = new MyLogger();
9
var postUrl = "https://facebook.com/some/fb/post";
10
var comments = await comment.GetCommentsAsync(postUrl, cookie, logger);
11
12
foreach (var comment in comments)
13
{
14
Console.WriteLine(comment.Text);
15
Console.WriteLine(comment.SenderName);
16
Console.WriteLine(comment.SenderUrl);
17
Console.WriteLine(comment.ReactionsCount);
18
19
foreach (var reply in comment.Replies)
20
{
21
Console.WriteLine(reply.Text);
22
Console.WriteLine(reply.SenderName);
23
Console.WriteLine(reply.SenderUrl);
24
Console.WriteLine(reply.ReactionsCount);
25
}
26
}
Copied!
The source code itself contains XML documentation for public methods, classes and properties. This is makes your development become much more easier!
Last modified 1yr ago
Copy link