(params, fb_dtsg)
| 595 | } |
| 596 | |
| 597 | export async function fetchGraphQl(params, fb_dtsg) { |
| 598 | let form; |
| 599 | if (typeof params === "string") |
| 600 | form = |
| 601 | "fb_dtsg=" + |
| 602 | encodeURIComponent(fb_dtsg) + |
| 603 | "&q=" + |
| 604 | encodeURIComponent(params); |
| 605 | else |
| 606 | form = wrapGraphQlParams({ |
| 607 | fb_dtsg, |
| 608 | ...params, |
| 609 | }); |
| 610 | |
| 611 | let res = await fetch("https://www.facebook.com/api/graphql/", { |
| 612 | body: form, |
| 613 | method: "POST", |
| 614 | headers: { "Content-Type": "application/x-www-form-urlencoded" }, |
| 615 | credentials: "include", |
| 616 | }); |
| 617 | |
| 618 | let json = await res.text(); |
| 619 | return json; |
| 620 | } |
| 621 | export function decodeArrId(arrId) { |
| 622 | return arrId[0] * 4294967296 + arrId[1]; |
| 623 | } |
no test coverage detected