fix(backend/x-bot): 고정 트윗 다음 트윗이 무시되는 버그 수정

- 고정 트윗 체크 로직이 이전 컨테이너를 참조하여 다음 트윗도 고정으로 판단하는 버그 수정
- 현재 컨테이너 내에 'class="pinned"'가 있는지만 확인하도록 변경

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
caadiq 2026-01-15 14:02:53 +09:00
parent 94fc7b4c7f
commit 2ebee0682c

View file

@ -153,9 +153,8 @@ async function fetchTweetsFromNitter(nitterUrl, username) {
const container = tweetContainers[i]; const container = tweetContainers[i];
const tweet = {}; const tweet = {};
// 고정 트윗 체크 // 고정 트윗 체크 - 현재 컨테이너 내에 pinned 클래스가 있는지 확인
tweet.isPinned = tweet.isPinned = container.includes('class="pinned"');
tweetContainers[i - 1].includes("pinned") || container.includes("Pinned");
// 리트윗 체크 // 리트윗 체크
tweet.isRetweet = container.includes('class="retweet-header"'); tweet.isRetweet = container.includes('class="retweet-header"');
@ -223,9 +222,8 @@ async function fetchAllTweetsFromNitter(nitterUrl, username) {
const container = tweetContainers[i]; const container = tweetContainers[i];
const tweet = {}; const tweet = {};
tweet.isPinned = // 고정 트윗 체크 - 현재 컨테이너 내에 pinned 클래스가 있는지 확인
tweetContainers[i - 1].includes("pinned") || tweet.isPinned = container.includes('class="pinned"');
container.includes("Pinned");
tweet.isRetweet = container.includes('class="retweet-header"'); tweet.isRetweet = container.includes('class="retweet-header"');
const linkMatch = container.match(/href="\/[^\/]+\/status\/(\d+)/); const linkMatch = container.match(/href="\/[^\/]+\/status\/(\d+)/);