Bhanunamikaze/Agentic-SEO-Skill
seo
VerifiedDeterministic LLM-first SEO audits for websites, blog posts, and GitHub repositories. Use this when the user asks to "perform SEO analysis", "run SEO audit", "analyze SEO", "check technical SEO", "review schema", "Core Web Vitals", "E-E-A-T", "hreflang", "GEO", "AEO", or GitHub repository SEO optimization. For full/page/repo audits, run bundled scripts for evidence and return prioritized, confidence-labeled fixes.
scripts/fetch_page.py
View on GitHub#!/usr/bin/env python3
"""
Fetch a web page with proper headers and error handling.
Usage:
python fetch_page.py https://example.com
python fetch_page.py https://example.com --output page.html
"""
import argparse
import sys
try:
import requests
except ImportError:
print("Error: requests library required. Install with: pip install requests")
sys.exit(1)
try:
from lib.safe_http import DEFAULT_HEADERS, normalize_url, safe_get
except ImportError:
from scripts.lib.safe_http import DEFAULT_HEADERS, normalize_url, safe_get
def fetch_page(
url: str,
timeout: int = 30,
follow_redirects: bool = True,
max_redirects: int = 5,
) -> dict:
"""
Fetch a web page and return response details.
Args:
url: The URL to fetch
timeout: Request timeout in seconds
follow_redirects: Whether to follow redirects
max_redirects: Maximum number of redirects to follow
Returns:
Dictionary with:
- url: Final URL after redirects
- status_code: HTTP status code
- content: Response body
- headers: Response headers
- redirect_chain: List of redirect URLs
- error: Error message if failed
"""
result = {
"url": url,
"status_code": None,
"content": None,
"headers": {},
"redirect_chain": [],
"error": None,
}
try:
url = normalize_url(url)
response = safe_get(
url,
headers=DEFAULT_HEADERS,
timeout=timeout,
allow_redirects=follow_redirects,
max_redirects=max_redirects,
)
result["url"] = response.url
result["status_code"] = response.status_code
result["content"] = response.text
result["headers"] = dict(response.headers)
# Track redirect chain
if response.history:
result["redirect_chain"] = [r.url for r in response.history]
except requests.exceptions.Timeout:
result["error"] = f"Request timed out after {timeout} seconds"
except requests.exceptions.TooManyRedirects:
result["error"] = f"Too many redirects (max {max_redirects})"
except requests.exceptions.SSLError as e:
result["error"] = f"SSL error: {e}"
except requests.exceptions.ConnectionError as e:
result["error"] = f"Connection error: {e}"
except requests.exceptions.RequestException as e:
result["error"] = f"Request failed: {e}"
return result
def main():
parser = argparse.ArgumentParser(description="Fetch a web page for SEO analysis")
parser.add_argument("url", help="URL to fetch")
parser.add_argument("--output", "-o", help="Output file path")
parser.add_argument("--timeout", "-t", type=int, default=30, help="Timeout in seconds")
parser.add_argument("--no-redirects", action="store_true", help="Don't follow redirects")
args = parser.parse_args()
result = fetch_page(
args.url,
timeout=args.timeout,
follow_redirects=not args.no_redirects,
)
if result["error"]:
print(f"Error: {result['error']}", file=sys.stderr)
sys.exit(1)
if args.output:
with open(args.output, "w", encoding="utf-8") as f:
f.write(result["content"])
print(f"Saved to {args.output}")
else:
print(result["content"])
# Print metadata to stderr
print(f"\nURL: {result['url']}", file=sys.stderr)
print(f"Status: {result['status_code']}", file=sys.stderr)
if result["redirect_chain"]:
print(f"Redirects: {' -> '.join(result['redirect_chain'])}", file=sys.stderr)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |