AgriciDaniel/claude-blog / skills/blog-google
blog-google
VerifiedCredentialed Google API calls for a blog: PageSpeed Insights, CrUX history, Search Console performance and URL Inspection, GA4 organic traffic, Cloud NLP entities, YouTube video search, Google Ads Keyword Planner, and the Indexing API (job and livestream pages only). Uses the user's Google credentials, quotas, and sometimes billing, and asks for consent before the first call. Runs only on an explicit request: /blog google, "run PageSpeed on this blog URL", "pull my Search Console data", "inspect this URL's index status", "set up Google API credentials". Shares config with claude-seo at ~/.config/claude-seo/google-api.json.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 19.2 KB |
| assets/templates/cwv-audit-report.md | markdown | 1.6 KB |
| assets/templates/gsc-performance-report.md | markdown | 1.2 KB |
| assets/templates/indexation-status-report.md | markdown | 1.1 KB |
| references/api-reference.md | markdown | 9.3 KB |
| references/auth-setup.md | markdown | 7.1 KB |
| references/rate-limits-quotas.md | markdown | 4.6 KB |
| references/search-currentness.md | markdown | 12.5 KB |
| scripts/__init__.py | script | 0 B |
| scripts/crux_history.py | script | 11.0 KB |
| scripts/ga4_report.py | script | 17.0 KB |
| scripts/google_auth.py | script | 42.0 KB |
| scripts/google_report.py | script | 37.4 KB |
| scripts/gsc_inspect.py | script | 19.3 KB |
| scripts/gsc_query.py | script | 15.6 KB |
| scripts/indexing_notify.py | script | 15.1 KB |
| scripts/keyword_planner.py | script | 12.0 KB |
| scripts/nlp_analyze.py | script | 19.3 KB |
| scripts/pagespeed_check.py | script | 23.0 KB |
| scripts/requirements.lock | other | 103.0 KB |
| scripts/requirements.txt | manifest | 909 B |
| scripts/run.py | script | 4.2 KB |
| scripts/runtime_paths.py | script | 2.6 KB |
| scripts/setup_environment.py | script | 7.0 KB |
| scripts/youtube_search.py | script | 14.6 KB |
scripts/run.py
View on GitHub#!/usr/bin/env python3
"""
Universal runner for Blog Google skill scripts
Ensures all scripts run with the correct virtual environment
"""
import os
import sys
import subprocess
import hashlib
from pathlib import Path
# Load only the helper shipped beside this installed script, never from CWD.
sys.path.insert(0, str(Path(__file__).resolve().parent))
from runtime_paths import resolve_runtime_paths
def get_venv_python():
"""Get the virtual environment Python executable"""
skill_dir = Path(__file__).resolve().parent.parent
venv_dir = resolve_runtime_paths(skill_dir, "blog-google").venv
if os.name == 'nt': # Windows
venv_python = venv_dir / "Scripts" / "python.exe"
else: # Unix/Linux/Mac
venv_python = venv_dir / "bin" / "python"
return venv_python
def ensure_venv():
"""Return a ready interpreter without installing or updating anything."""
skill_dir = Path(__file__).resolve().parent.parent
venv_dir = resolve_runtime_paths(skill_dir, "blog-google").venv
lock_file = skill_dir / "scripts" / "requirements.lock"
requirements_file = skill_dir / "scripts" / "requirements.txt"
stamp_file = venv_dir / ".requirements.stamp"
source = lock_file if lock_file.exists() else requirements_file
expected_stamp = hashlib.sha256(source.read_bytes()).hexdigest() if source.exists() else None
current_stamp = stamp_file.read_text().strip() if stamp_file.exists() else None
venv_python = get_venv_python()
setup_script = skill_dir / "scripts" / "setup_environment.py"
if not venv_python.is_file():
print(f'Google skill setup required. Run: python3 "{setup_script}"')
sys.exit(1)
if expected_stamp and current_stamp != expected_stamp:
print(f'Google skill dependencies are missing or stale. Run: python3 "{setup_script}"')
sys.exit(1)
return venv_python
USAGE = """Usage: python run.py <script_name> [args...]
Available scripts:
google_auth.py - Credential management and auth setup
pagespeed_check.py - PageSpeed Insights + CrUX field data
crux_history.py - CWV history, 25 weeks by default, up to 40
youtube_search.py - YouTube video search and details
nlp_analyze.py - NLP entity extraction and sentiment
gsc_query.py - Search Console performance data
gsc_inspect.py - URL Inspection API
indexing_notify.py - Indexing API notifications
ga4_report.py - GA4 organic traffic reports
keyword_planner.py - Google Ads Keyword Planner
google_report.py - PDF/HTML performance reports
Run "python run.py <script_name> --help" for a script's options."""
def main():
"""Main runner"""
if len(sys.argv) >= 2 and sys.argv[1] in ("-h", "--help", "help"):
print(USAGE)
sys.exit(0)
if len(sys.argv) < 2:
print(USAGE)
sys.exit(1)
script_name = sys.argv[1]
script_args = sys.argv[2:]
# Handle both "scripts/script.py" and "script.py" formats
if script_name.startswith('scripts/'):
script_name = script_name[8:] # len('scripts/') = 8
# Ensure .py extension
if not script_name.endswith('.py'):
script_name += '.py'
# Get script path
skill_dir = Path(__file__).resolve().parent.parent
scripts_dir = (skill_dir / "scripts").resolve()
script_path = (scripts_dir / script_name).resolve()
try:
script_path.relative_to(scripts_dir)
except ValueError:
print(f"Script path escapes scripts directory: {script_name}")
sys.exit(1)
if not script_path.is_file():
print(f"Script not found: {script_name}")
print(f" Skill directory: {skill_dir}")
print(f" Looked for: {script_path}")
sys.exit(1)
# Ensure venv exists and get Python executable
try:
venv_python = ensure_venv()
except ValueError as exc:
print(f"ERROR: {exc}")
sys.exit(1)
# Build command
cmd = [str(venv_python), str(script_path)] + script_args
# Run the script
try:
result = subprocess.run(cmd)
sys.exit(result.returncode)
except KeyboardInterrupt:
print("\nInterrupted by user")
sys.exit(130)
except Exception as e:
print(f"Error: {e}")
sys.exit(1)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |