| from pydantic import BaseModel |
| from typing import Optional, List |
| from datetime import datetime |
|
|
| class UserModel(BaseModel): |
| username: str |
| password: str |
| created_at: str = "" |
|
|
| class CrawlRequest(BaseModel): |
| url: str |
| username: str |
| password: str |
|
|
| class CrawlStatus(BaseModel): |
| task_id: str |
| url: str |
| status: str |
| progress: int = 0 |
| pages_crawled: int = 0 |
| error: Optional[str] = None |
| started_at: Optional[str] = None |
| completed_at: Optional[str] = None |
|
|
| class PageData(BaseModel): |
| url: str |
| title: Optional[str] = None |
| description: Optional[str] = None |
| keywords: List[str] = [] |
| h1: List[str] = [] |
| h2: List[str] = [] |
| h3: List[str] = [] |
| paragraphs: List[str] = [] |
| content_text: str = "" |
| word_count: int = 0 |
| sentence_count: int = 0 |
| reading_time_min: int = 0 |
| heading_count: int = 0 |
| geo_score: int = 0 |
| aeo_ready: bool = False |
| has_schema: bool = False |
| has_opengraph: bool = False |
| has_lists: bool = False |
| has_qa_pattern: bool = False |
| status_code: int = 200 |
| content_type: Optional[str] = None |
|
|
| class CrawlResult(BaseModel): |
| url: str |
| status: str |
| pages_crawled: int = 0 |
| total_words: int = 0 |
| seo_score: int = 0 |
| geo_score: int = 0 |
| aeo_score: int = 0 |
| health_score: int = 0 |
| pages: List[PageData] = [] |
| keywords: List[dict] = [] |
| schema_types: List[dict] = [] |
| llm_mentions: dict = {} |
| blog_posts: List[dict] = [] |
| crawled_at: str = "" |
|
|