하량이슬 [1396596] · MS 2025 · 쪽지

2025-06-16 23:02:11
조회수 106

전체 글 삭제 매크로

게시글 주소: https://orbi.kr/00073503041


오류 알려주세요..



1. 자기 글 목록 열고, F12 누르기


2. console(콘솔) 탭 클릭


3. 아래 코드 붙여넣기 후 엔터

(붙여넣기 안 되면 allow pasting 입력 하고나서 다시)





(async function() {

    const scrollDelayMs = 1000;

    const deleteDelayMs = 100;


    let deletedCount = 0;

    let errorCount = 0;

    let articleIdsToDelete = [];


    async function autoScrollToBottom() {

        let lastScrollHeight = 0;

        while (true) {

            window.scrollTo(0, document.body.scrollHeight);

            await new Promise(resolve => setTimeout(resolve, scrollDelayMs));

            const newScrollHeight = document.body.scrollHeight;

            if (newScrollHeight === lastScrollHeight) {

                break;

            }

            lastScrollHeight = newScrollHeight;

        }

    }


    function collectArticleIds() {

        const articleLinks = document.querySelectorAll('.timeline-wrap article .content');

        const ids = [];

        articleLinks.forEach(link => {

            const href = link.getAttribute('href');

            const match = href.match(/\/(\d+)\//);

            if (match && match[1]) {

                ids.push(match[1]);

            }

        });

        return [...new Set(ids)];

    }


    async function deleteArticle(articleId) {

        const deleteUrl = `/delete/${articleId}`;

        try {

            const response = await fetch(deleteUrl, {

                method: 'POST',

                credentials: 'include',

                headers: {

                    'Accept': 'application/json, text/plain, */*',

                    'Accept-Language': 'ko-KR,ko;q=0.9',

                    'Content-Length': '0',

                    'Referer': `https://orbi.kr/000${articleId}`,

                    'sec-ch-ua': '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',

                    'sec-ch-ua-mobile': '?0',

                    'sec-ch-ua-platform': '"Windows"',

                    'sec-fetch-dest': 'empty',

                    'sec-fetch-mode': 'cors',

                    'sec-fetch-site': 'same-origin'

                },

                body: null

            });


            if (response.ok) {

                const data = await response.json();

                if (data.success) {

                    deletedCount++;

                    const articleElement = document.querySelector(`a[href*="/${articleId}/"]`);

                    if(articleElement) {

                        articleElement.closest('article').remove();

                    }

                } else {

                    errorCount++;

                }

            } else {

                errorCount++;

            }

        } catch (error) {

            errorCount++;

        }

    }


    await autoScrollToBottom();


    articleIdsToDelete = collectArticleIds();


    if (articleIdsToDelete.length === 0) {

        return;

    }


    let currentIndex = 0;

    const autoDeleteIntervalId = setInterval(async () => {

        if (currentIndex < articleIdsToDelete.length) {

            const articleId = articleIdsToDelete[currentIndex];

            await deleteArticle(articleId);

            currentIndex++;

        } else {

            clearInterval(autoDeleteIntervalId);

        }

    }, deleteDelayMs);

})();

0 XDK (+0)

  1. 유익한 글을 읽었다면 작성자에게 XDK를 선물하세요.