File size: 1,539 Bytes
7f1ccfb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
02544a0
 
 
 
7f1ccfb
02544a0
 
 
7f1ccfb
 
 
 
02544a0
 
7f1ccfb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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  # queued, running, completed, error
    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 = ""