feat: add devto article scraping PoC snippet#377
Conversation
…ack de clipboard - articleUrl agora remove /stats conforme issue he4rt#181 - articleSlug usa filter(Boolean).pop() apos remover /stats - reactionType extraido via split('\n')[0] em vez de querySelector('strong') - edge case de artigo sem reacoes agora retorna JSON estruturado - adicionado fallback de clipboard via execCommand quando foco esta no DevTools
📝 WalkthroughWalkthroughA new PoC spec file is added documenting a browser-console JavaScript snippet for extracting "Reactions History" data from a dev.to article's 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/superpowers/specs/2026-06-27-devto-article-scraping-poc.md (1)
73-75: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winUse
.includes()for heading match.Exact equality breaks if dev.to adds whitespace or icons.
h.textContent.trim().includes('Reactions History')is more resilient.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/superpowers/specs/2026-06-27-devto-article-scraping-poc.md` around lines 73 - 75, The heading lookup in the DOM scan is too strict and can miss the target when dev.to adds extra text, whitespace, or icons. Update the logic in the header iteration that assigns rhHeader to use a resilient match with includes() on h.textContent.trim() instead of exact equality, while keeping the existing Reactions History check in the same heading-selection flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/superpowers/specs/2026-06-27-devto-article-scraping-poc.md`:
- Around line 19-24: The page check in the self-invoking script only validates
the pathname, so it can run on non-dev.to domains. Update the validation in the
top-level IIFE to also check window.location.hostname includes dev.to before
proceeding, keeping the existing /stats path guard in place.
---
Nitpick comments:
In `@docs/superpowers/specs/2026-06-27-devto-article-scraping-poc.md`:
- Around line 73-75: The heading lookup in the DOM scan is too strict and can
miss the target when dev.to adds extra text, whitespace, or icons. Update the
logic in the header iteration that assigns rhHeader to use a resilient match
with includes() on h.textContent.trim() instead of exact equality, while keeping
the existing Reactions History check in the same heading-selection flow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 9c32960e-dfab-4da9-8ec6-7a9c42db9b0f
📒 Files selected for processing (1)
docs/superpowers/specs/2026-06-27-devto-article-scraping-poc.md
| (() => { | ||
| // Validação: está na página certa? | ||
| if (!window.location.pathname.endsWith('/stats')) { | ||
| console.error('❌ Execute este script na página /stats de um artigo do dev.to'); | ||
| return; | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Incomplete page validation.
endsWith('/stats') allows any domain. Add window.location.hostname.includes('dev.to') to ensure this runs only on dev.to.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/superpowers/specs/2026-06-27-devto-article-scraping-poc.md` around lines
19 - 24, The page check in the self-invoking script only validates the pathname,
so it can run on non-dev.to domains. Update the validation in the top-level IIFE
to also check window.location.hostname includes dev.to before proceeding,
keeping the existing /stats path guard in place.


Closes #181
Implementado snippet de DOM scraping para extração de Reactions History da página /stats do dev.to, conforme especificado na issue.
O script extrai: type, username, userProfileUrl, userAvatarUrl e date de cada reação, monta JSON estruturado e copia pro clipboard.
Documentado em docs/superpowers/specs/ seguindo o padrão do projeto.
Edge cases tratados:
Testado manualmente: