fix: X 폼 Nitter 파싱 수정 및 아이콘 변경
- scraper.js: main-tweet 파싱 정규식 수정 (id 선택자 사용) - XForm.jsx: Twitter 아이콘을 X 로고로 변경 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bc3f536ec7
commit
84ed48fa78
2 changed files with 17 additions and 4 deletions
|
|
@ -141,8 +141,8 @@ export async function fetchSingleTweet(nitterUrl, username, postId) {
|
|||
|
||||
const html = await res.text();
|
||||
|
||||
// 메인 트윗 파싱 (main-tweet 클래스)
|
||||
const mainTweetMatch = html.match(/<div class="main-tweet"[^>]*>([\s\S]*?)<\/div>\s*<div class="replies">/);
|
||||
// 메인 트윗 파싱 (main-tweet ~ replies 사이)
|
||||
const mainTweetMatch = html.match(/<div id="m" class="main-tweet">([\s\S]*?)<div id="r" class="replies">/);
|
||||
if (!mainTweetMatch) {
|
||||
throw new Error('트윗 내용을 파싱할 수 없습니다');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { useState } from "react";
|
|||
import { useNavigate } from "react-router-dom";
|
||||
import { motion } from "framer-motion";
|
||||
import {
|
||||
Twitter,
|
||||
Hash,
|
||||
Loader2,
|
||||
Check,
|
||||
|
|
@ -10,9 +9,23 @@ import {
|
|||
Save,
|
||||
Image as ImageIcon,
|
||||
} from "lucide-react";
|
||||
|
||||
import Toast from "../../../../../components/Toast";
|
||||
import useToast from "../../../../../hooks/useToast";
|
||||
|
||||
// X 로고 아이콘
|
||||
const XLogo = ({ size = 24, className = "" }) => (
|
||||
<svg
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox="0 0 24 24"
|
||||
fill="currentColor"
|
||||
className={className}
|
||||
>
|
||||
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
/**
|
||||
* X(Twitter) 일정 추가 폼
|
||||
* - 게시글 ID 입력 시 자동으로 정보 조회
|
||||
|
|
@ -151,7 +164,7 @@ function XForm() {
|
|||
{/* 게시글 ID 입력 */}
|
||||
<div className="bg-white rounded-2xl shadow-sm p-8">
|
||||
<div className="flex items-center gap-2 mb-6">
|
||||
<Twitter size={24} className="text-black" />
|
||||
<XLogo size={24} className="text-black" />
|
||||
<h2 className="text-lg font-bold text-gray-900">X 게시글</h2>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue