blog-post-counterlisted
Install: claude install-skill Infrasity-Labs/dev-gtm-claude-skills
# Blog Post Counter Skill
Counts and compares blog post output across a target company and its competitors, ranking them so the user can see where their target stands.
## Workflow
### Step 1 — Resolve each company to a URL
For each company name provided:
1. If a URL was given directly, use it.
2. If only a name was given, run `curl -sL "https://<likely-domain>/robots.txt"` to confirm the site exists and find the sitemap. If that 404s, do a quick web search for `"<company name>" official website` to get the correct domain.
### Step 2 — Find the sitemap
From the robots.txt, extract the `Sitemap:` line(s). Common patterns:
- Single sitemap: `Sitemap: https://example.com/sitemap.xml`
- Sitemap index: multiple `Sitemap:` lines, or a sitemap-index.xml that references sub-sitemaps
If no sitemap is in robots.txt, try these fallbacks in order:
```
/sitemap.xml
/sitemap_index.xml
/sitemap-index.xml
/blog/sitemap.xml
```
### Step 3 — Count blog posts
Fetch the sitemap and count URLs that are blog posts. Use this bash pattern:
```bash
curl -sL -A "Mozilla/5.0" "https://example.com/sitemap.xml" \
| grep -o '<loc>[^<]*</loc>' \
| grep -iE '/blog/|/posts?/|/articles?/|/news/' \
| grep -v -E '^<loc>https://[^/]+/blog/?</loc>$' \
| wc -l
```
**Important:** Exclude the blog index page itself (e.g. `/blog` or `/blog/`) — count only individual post URLs.
**Sitemap index handling:** If the sitemap is an index (contains `<sitemap>` tags rather than `<url>` tags), extract the su