MCPcopy Create free account
hub / github.com/Makepad-fr/fbjs / getGroupPosts

Function getGroupPosts

example/src/index.ts:4–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import GroupPost from '../../dist/lib/models/groupPost';
3
4async function getGroupPosts() {
5 const fb = await FB.init({
6 groupIds: [],
7 useCookies: true,
8 disableAssets: true,
9 headless: false,
10 debug: false,
11 output: './',
12 }, './cookies.json');
13 try {
14 await fb.login(
15 process.env.FACEBOOK_USERNAME!,
16 process.env.FACEBOOK_PASSWORD!,
17 );
18 } catch (e) {
19 if (e instanceof TwoFARequiredError) {
20 await fb.enterAuthCode(process.env.FACEBOOK_2FA_CODE!);
21 }
22 }
23 await fb.getGroupPosts(parseInt(process.env.FACEBOOK_GROUP_ID!, 10), undefined, (g: GroupPost) => console.log(g), false);
24}
25
26getGroupPosts().then();

Callers 1

index.tsFile · 0.85

Calls 4

initMethod · 0.80
loginMethod · 0.80
enterAuthCodeMethod · 0.80
getGroupPostsMethod · 0.80

Tested by

no test coverage detected