Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 1.49 KB

fb_fetchalladdedfriends-js.md

File metadata and controls

9 lines (8 loc) · 1.49 KB
title date categories
Fb_fetchAllAddedFriends.Js
2023-11-23
useful-script-en

how to add bookmarklet in chrome
import { showLoading } from "./helpers/utils.js"; export default { icon: '', name: { en: "Facebook – Fetch all added friends", vi: "Facebook – View all friends added", }, description: { en: "View all friends added to your Facebook account.", en: "See a list of all facebook friends who have friended you.", }, onClickExtension: async() => { let { setLoadingText, closeLoading } = showLoading("Preparing..."); try { let { getYourUserId, getFbdtsg, fetchAddedFriends, fetchAllAddedFriendsSince, } = UsefulScriptGlobalPageContext.Facebook; setLoadingText("Taking uid, token..."); let uid = await getYourUserId(); let dtsg = await getFbdtsg(); setLoadingText("Loading information..."); // let twoMonthAgo = parseInt(new Date() / 1e3 – 5184e3).toString(); const allFriends = await fetchAllAddedFriendsSince( uid, dtsg, null, // twoMonthAgo (data, total) => { let lastest = data[data.length – 1]; setLoadingText( 'Getting information... ' + 'Load ${total.length} you. ' + 'Time: ' + new Date(lastest?. addedTime).toLocaleDateString() ); } ); console.log(allFriends); } catch (e) { alert("ERROR: " + e); } finally { closeLoading(); } }, };