48 lines
1.9 KiB
Python
48 lines
1.9 KiB
Python
from src.database.session import db_manager
|
|
from src.database.repositories import GeneratedContentRepository, ArticleLinkRepository
|
|
|
|
session = db_manager.get_session()
|
|
try:
|
|
content_repo = GeneratedContentRepository(session)
|
|
link_repo = ArticleLinkRepository(session)
|
|
|
|
articles = content_repo.get_by_project_id(1)
|
|
|
|
# Count all links
|
|
all_links = []
|
|
for article in articles:
|
|
all_links.extend(link_repo.get_by_source_article(article.id))
|
|
|
|
print(f'\n=== VERIFICATION RESULTS ===\n')
|
|
print(f'Total articles: {len(articles)}')
|
|
print(f'Total links created: {len(all_links)}\n')
|
|
|
|
# Get site info
|
|
from src.database.repositories import SiteDeploymentRepository
|
|
site_repo = SiteDeploymentRepository(session)
|
|
|
|
for article in articles[:2]:
|
|
site = site_repo.get_by_id(article.site_deployment_id) if article.site_deployment_id else None
|
|
site_name = site.custom_hostname if site else 'None'
|
|
|
|
print(f'Article {article.id}: {article.title[:60]}...')
|
|
print(f' Site ID: {article.site_deployment_id}')
|
|
print(f' Site Hostname: {site_name}')
|
|
print(f' Has links: {"<a href=" in article.content}')
|
|
print(f' Has See Also: {"See Also" in article.content}')
|
|
print(f' Has money site link: {"example-moneysite.com" in article.content}')
|
|
print(f' Has Home link: {"Home</a>" in article.content}')
|
|
print(f' Has formatted_html: {article.formatted_html is not None}')
|
|
print(f' Template used: {article.template_used}')
|
|
|
|
outbound_links = link_repo.get_by_source_article(article.id)
|
|
print(f' Outbound links: {len(outbound_links)}')
|
|
for link in outbound_links:
|
|
target = link.to_url or f"article {link.to_content_id}"
|
|
print(f' - {link.link_type}: -> {target}')
|
|
print()
|
|
|
|
finally:
|
|
session.close()
|
|
|