Skip to content

notque/vexjoy-agent / skills/content/content

content

Unverified

Content operations: editorial calendar, marketing, publishing, social media management.

FileKindSize
SKILL.mdskill md11.5 KB
references/at-protocol-api.mdmarkdown7.6 KB
references/at-protocol-preferred-patterns.mdmarkdown8.5 KB
references/batch-edit-examples.mdmarkdown6.9 KB
references/batch-edit-operation-types.mdmarkdown7.0 KB
references/batch-edit-regex-patterns.mdmarkdown5.4 KB
references/batch-edit-safety-checklist.mdmarkdown6.0 KB
references/batch-edit.mdmarkdown9.9 KB
references/calendar-format.mdmarkdown3.5 KB
references/campaign-planning.mdmarkdown17.5 KB
references/classification-prompt.mdmarkdown5.9 KB
references/content-engine.mdmarkdown8.7 KB
references/content-engine/error-handling.mdmarkdown7.8 KB
references/content-engine/phase-playbook.mdmarkdown8.3 KB
references/content-engine/platform-specs.mdmarkdown10.9 KB
references/content-strategy.mdmarkdown14.5 KB
references/email-sequences.mdmarkdown15.8 KB
references/error-handling.mdmarkdown8.2 KB
references/headlines.mdmarkdown5.9 KB
references/image-audit-alt-text-examples.mdmarkdown6.8 KB
references/image-audit-format-selection.mdmarkdown5.8 KB
references/image-audit-report-templates.mdmarkdown3.8 KB
references/image-audit-size-guidelines.mdmarkdown4.2 KB
references/image-audit.mdmarkdown10.4 KB
references/link-audit-false-positives.mdmarkdown4.1 KB
references/link-audit-fix-strategies.mdmarkdown7.1 KB
references/link-audit-graph-metrics.mdmarkdown5.0 KB
references/link-audit.mdmarkdown7.8 KB
references/llm-marketing-failure-modes.mdmarkdown18.7 KB
references/marketing.mdmarkdown20.4 KB
references/metrics.mdmarkdown7.4 KB
references/news-collection.mdmarkdown5.2 KB
references/operations.mdmarkdown5.8 KB
references/outline-examples.mdmarkdown11.2 KB
references/outline-structure-templates.mdmarkdown6.4 KB
references/outline.mdmarkdown8.9 KB
references/pagespeed-insights.mdmarkdown10.4 KB
references/pipeline-stages.mdmarkdown3.3 KB
references/pre-publish-checklist.mdmarkdown7.4 KB
references/pre-publish-hugo-frontmatter.mdmarkdown5.3 KB
references/pre-publish-seo-guidelines.mdmarkdown4.1 KB
references/pre-publish.mdmarkdown10.8 KB
references/reddit-moderate.mdmarkdown7.9 KB
references/script-commands.mdmarkdown3.7 KB
references/seo-audit.mdmarkdown16.4 KB
references/seo-guidelines.mdmarkdown5.5 KB
references/seo-keyword-placement.mdmarkdown6.0 KB
references/seo-title-patterns.mdmarkdown5.6 KB
references/seo.mdmarkdown8.9 KB
references/series-planner.mdmarkdown11.7 KB
references/series-planner/cadence-guidelines.mdmarkdown6.8 KB
references/series-planner/cross-linking.mdmarkdown7.2 KB
references/series-planner/output-format.mdmarkdown3.8 KB
references/series-planner/series-types.mdmarkdown7.6 KB
references/taxonomy-audit-report-format.mdmarkdown3.2 KB
references/taxonomy-consolidation-rules.mdmarkdown6.7 KB
references/taxonomy-examples.mdmarkdown9.7 KB
references/taxonomy-guidelines.mdmarkdown5.5 KB
references/taxonomy.mdmarkdown9.0 KB
references/topic-brainstormer.mdmarkdown10.1 KB
references/topic-brainstormer/content-filter.mdmarkdown7.1 KB
references/topic-brainstormer/priority-scoring.mdmarkdown8.1 KB
references/topic-brainstormer/topic-sources.mdmarkdown7.6 KB
references/wordpress-upload.mdmarkdown11.2 KB
references/x-api.mdmarkdown7.8 KB
scripts/publish/link_scanner.pyscript21.4 KB
scripts/publish/pagespeed.pyscript15.3 KB
scripts/publish/tests/test_load_env_file.pyscript3.8 KB
scripts/publish/tests/test_wordpress_inline_urls.pyscript4.4 KB
scripts/publish/tests/test_wordpress_media_upload.pyscript1.5 KB
scripts/publish/tests/test_wordpress_scraper.pyscript4.1 KB
scripts/publish/wordpress-edit-post.pyscript21.2 KB
scripts/publish/wordpress-media-upload.pyscript8.7 KB
scripts/publish/wordpress-scraper.pyscript23.4 KB
scripts/publish/wordpress-upload.pyscript44.2 KB
scripts/reddit-moderate/reddit-automod-cron.shscript3.9 KB
scripts/reddit-moderate/reddit-mod.pyscript83.0 KB
scripts/reddit-moderate/tests/test_reddit_mod.pyscript31.3 KB

scripts/publish/tests/test_wordpress_scraper.py

View on GitHub
"""Tests for wordpress-scraper.py frontmatter and image-size safety."""

from __future__ import annotations

import importlib.util
from pathlib import Path
from types import SimpleNamespace
from unittest.mock import patch

import pytest

PUBLISH_DIR = Path(__file__).parent.parent

requests = pytest.importorskip("requests")

_spec = importlib.util.spec_from_file_location(
    "wordpress_scraper",
    PUBLISH_DIR / "wordpress-scraper.py",
)
_mod = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(_mod)

build_frontmatter = _mod.build_frontmatter
download_image = _mod.download_image
MAX_IMAGE_BYTES = _mod.MAX_IMAGE_BYTES


# -- Frontmatter title tests --------------------------------------------------


class TestBuildFrontmatterTitle:
    """Tests for control-character handling in build_frontmatter."""

    def _post(self, title: str) -> dict:
        """Build a minimal post dict with the given title."""
        return {
            "title": title,
            "date": "2024-01-01",
            "slug": "test",
            "author": {"name": "Test"},
            "URL": "https://example.com/test/",
            "categories": {},
            "tags": {},
        }

    def test_newline_in_title_no_extra_key(self) -> None:
        """A title with a newline followed by 'slug:' must not inject a key."""
        post = self._post("Hello\nslug: injected")
        fm = build_frontmatter(post, "https://example.com")
        lines = fm.strip().split("\n")
        # Count how many lines start with 'slug:'
        slug_lines = [ln for ln in lines if ln.startswith("slug:")]
        assert len(slug_lines) == 1, f"Expected 1 slug line, got {len(slug_lines)}: {slug_lines}"

    def test_cr_lf_collapsed(self) -> None:
        """CR and LF inside a title become a space."""
        post = self._post("A\r\nB")
        fm = build_frontmatter(post, "https://example.com")
        assert "A B" in fm

    def test_tab_collapsed(self) -> None:
        """Tab characters collapse to a space."""
        post = self._post("A\tB")
        fm = build_frontmatter(post, "https://example.com")
        assert "A B" in fm

    def test_plain_title_unchanged(self) -> None:
        """A normal title passes through without mangling."""
        post = self._post("Hello World")
        fm = build_frontmatter(post, "https://example.com")
        assert 'title: "Hello World"' in fm


# -- Image size limit tests ----------------------------------------------------


class _FakeResponse:
    """Minimal fake requests.Response for download_image tests."""

    def __init__(self, content: bytes, status_code: int = 200, content_length: str | None = None) -> None:
        self.content = content
        self.status_code = status_code
        self.headers: dict[str, str] = {}
        if content_length is not None:
            self.headers["Content-Length"] = content_length


class TestDownloadImageSizeLimit:
    """Tests for MAX_IMAGE_BYTES enforcement in download_image."""

    def test_small_image_downloads(self, tmp_path: Path) -> None:
        """An image under the limit is saved."""
        fake_resp = _FakeResponse(b"\x89PNG" + b"\x00" * 100)
        with patch.object(_mod, "_rate_limited_get", return_value=fake_resp):
            result = download_image("https://example.com/small.png", tmp_path)
        assert result is not None
        assert (tmp_path / result).exists()

    def test_large_content_length_skipped(self, tmp_path: Path) -> None:
        """An image whose Content-Length exceeds the limit is skipped."""
        fake_resp = _FakeResponse(b"", content_length=str(MAX_IMAGE_BYTES + 1))
        with patch.object(_mod, "_rate_limited_get", return_value=fake_resp):
            result = download_image("https://example.com/huge.png", tmp_path)
        assert result is None

    def test_large_body_skipped(self, tmp_path: Path) -> None:
        """An image whose body exceeds the limit (no Content-Length) is skipped."""
        big_body = b"\x00" * (MAX_IMAGE_BYTES + 1)
        fake_resp = _FakeResponse(big_body)
        with patch.object(_mod, "_rate_limited_get", return_value=fake_resp):
            result = download_image("https://example.com/huge.png", tmp_path)
        assert result is None
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 197kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall