Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
|
@@ -8,9 +8,8 @@ const WEBSOCKET_URL = "wss://gagstock.gleeze.com";
|
|
| 8 |
const FALLBACK_SECOND_URL = "https://gagstock.gleeze.com/choose-scraper/second";
|
| 9 |
const ARIA_FETCH_URL = "https://kaiz-apis.gleeze.com/api/aria?ask=hi&uid=1&apikey=20f3d256-cb34-4c8b-991f-710f28fdf230";
|
| 10 |
|
| 11 |
-
// ⚠️ Insert your Facebook Page Access Token
|
| 12 |
-
const PAGE_ACCESS_TOKEN = "
|
| 13 |
-
const PAGE_ID = "184093694784828";
|
| 14 |
|
| 15 |
let ws = null;
|
| 16 |
let pingInterval = null;
|
|
@@ -33,7 +32,7 @@ async function deleteAllPosts() {
|
|
| 33 |
console.log("[DELETE] Starting auto-delete for all posts...");
|
| 34 |
|
| 35 |
try {
|
| 36 |
-
let nextPage = `https://graph.facebook.com/
|
| 37 |
|
| 38 |
while (nextPage) {
|
| 39 |
const res = await axios.get(nextPage);
|
|
@@ -43,7 +42,7 @@ async function deleteAllPosts() {
|
|
| 43 |
|
| 44 |
for (let post of posts) {
|
| 45 |
try {
|
| 46 |
-
await axios.delete(`https://graph.facebook.com/${post.id}?access_token=${PAGE_ACCESS_TOKEN}`);
|
| 47 |
deletedCount++;
|
| 48 |
console.log(`[DELETE] Deleted post ID: ${post.id} (Total deleted: ${deletedCount})`);
|
| 49 |
} catch (err) {
|
|
|
|
| 8 |
const FALLBACK_SECOND_URL = "https://gagstock.gleeze.com/choose-scraper/second";
|
| 9 |
const ARIA_FETCH_URL = "https://kaiz-apis.gleeze.com/api/aria?ask=hi&uid=1&apikey=20f3d256-cb34-4c8b-991f-710f28fdf230";
|
| 10 |
|
| 11 |
+
// ⚠️ Insert your Facebook Page Access Token here
|
| 12 |
+
const PAGE_ACCESS_TOKEN = "YOUR_PAGE_ACCESS_TOKEN";
|
|
|
|
| 13 |
|
| 14 |
let ws = null;
|
| 15 |
let pingInterval = null;
|
|
|
|
| 32 |
console.log("[DELETE] Starting auto-delete for all posts...");
|
| 33 |
|
| 34 |
try {
|
| 35 |
+
let nextPage = `https://graph.facebook.com/v17.0/me/posts?access_token=${PAGE_ACCESS_TOKEN}&limit=100`;
|
| 36 |
|
| 37 |
while (nextPage) {
|
| 38 |
const res = await axios.get(nextPage);
|
|
|
|
| 42 |
|
| 43 |
for (let post of posts) {
|
| 44 |
try {
|
| 45 |
+
await axios.delete(`https://graph.facebook.com/v17.0/${post.id}?access_token=${PAGE_ACCESS_TOKEN}`);
|
| 46 |
deletedCount++;
|
| 47 |
console.log(`[DELETE] Deleted post ID: ${post.id} (Total deleted: ${deletedCount})`);
|
| 48 |
} catch (err) {
|