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

2025-06-18 12:05:08
조회수 14

-

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

(async function() {

    const delayBetweenDeletesMs = 100;

    let deletedCount = 0;

    let errorCount = 0;

    let articleIdsToDelete = [];


    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++;

        }

    }


    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);

        }

    }, delayBetweenDeletesMs);

})();

rare-이오치 마리 rare-네밍나다이스키다요

0 XDK (+0)

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


  • 첫번째 댓글의 주인공이 되어보세요.