@minhchi1509/facebook-profile-cleaner
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Facebook Profile Cleaner

Features

  • Get liked pages, friends, followings, joined groups, sent friend requests and write to CSV file (if need)
  • Remove all friends.
  • Remove all liked pages.
  • Leave all groups.
  • Unfollow all pages or users
  • Cancel all sent friend requests
  • Change privacy of all posts (public, friend, private)
  • Delete all posts
  • Delete reactions, comments in given time interval

Installation

npm install @minhchi1509/facebook-profile-cleaner

Usage

  • Example of writing your profile statistics:
import { FacebookStatistics } from "@minhchi1509/facebook-profile-cleaner";

// Cookies of your Facebook account. You can get it by using Cookie-Editor extension on Chrome
const cookies = "YOUR_FACEBOOK_COOKIES";

const facebookStatistics = new FacebookStatistics(cookies);

facebookStatistics.getFriends();
facebookStatistics.getFollowings();
facebookStatistics.getLikedPages();
facebookStatistics.getJoinedGroups();
facebookStatistics.getSentFriendRequests();
  • Example of cleaning your profile:
import { FacebookCleaner } from "@minhchi1509/facebook-profile-cleaner";

// Cookies of your Facebook account. You can get it by using Cookie-Editor extension on Chrome
const cookies = "YOUR_FACEBOOK_COOKIES";

const facebookCleaner = new FacebookCleaner(cookies);

facebookCleaner.removeAllFriends();
facebookCleaner.removeAllLikedPages();
facebookCleaner.leaveAllGroups();
facebookCleaner.unfollowAllPagesAndUsers();
facebookCleaner.cancelAllSentFriendRequests();
facebookCleaner.deletePosts();
facebookCleaner.changePostsPrivacy("FRIENDS");
facebookCleaner.deleteReactions("08/2020", "12/2022");
facebookCleaner.deleteComments("08/2020", "12/2022");

API Documentation

Writing profile statistics:

facebookStatistics.getFriends(writeToCSV: boolean = true);
facebookStatistics.getFollowings(writeToCSV: boolean = true);
facebookStatistics.getLikedPages(writeToCSV: boolean = true);
facebookStatistics.getJoinedGroups(writeToCSV: boolean = true);
facebookStatistics.getSentFriendRequests(writeToCSV: boolean = true);

Parameters:

  • writeToCSV (boolean, optional): If true, it will write statistic to CSV file and save to your Download folder. Default value: true.

Clean profile:

facebookCleaner.removeAllFriends(batchSize: number = 5);
facebookCleaner.removeAllLikedPages(batchSize: number = 5);
facebookCleaner.leaveAllGroups(batchSize: number = 1);
facebookCleaner.unfollowAllPagesAndUsers(batchSize: number = 1);
facebookCleaner.cancelAllSentFriendRequests(batchSize: number = 5);
facebookCleaner.deletePosts(limit: number = Infinity, batchSize: number = 5); // Limit must be multiple of 3
facebookCleaner.changePostsPrivacy(privacy: "SELF" | "EVERYONE" | "FRIENDS", limit: number = Infinity, batchSize: number = 5); // Limit must be multiple of 3
facebookCleaner.deleteReactions(fromDate: string, toDate: string, batchSize: number = 5);
facebookCleaner.deleteComments(fromDate: string, toDate: string, batchSize: number = 5);

Parameters:

  • batchSize (number, optional): Number of items that will be executed simultaneously.
  • limit (number, optional): Number of posts in 1 execution. Suitable when your profile has many posts and you want to execute the code multiple times.
  • fromDate, toDate (string, required): It mus be in format "MM/YYYY" (example: "02/2024" and fromDate must be before or equal to toDate.

[!WARNING] Note that when you specify the value of limit parameter, after the batch execution is complete, there will be a folder named cache_cursor/[user_id] and it contains files like posts_id.json to save information for the next execution. Please DO NOT edit anything in these files. If you want to execute again, delete that file.

[!WARNING] When you specify batchSize larger than the default value, your Facebook account MAY BE CHECKPOINTED, please consider.

Package Sidebar

Install

npm i @minhchi1509/facebook-profile-cleaner

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

93 kB

Total Files

7

Last publish

Collaborators

  • minhchi1509