Skip to content

Fix: Extract LeetCode Topic Tags and Forward to Publishing Platforms#201

Open
ayushi2577 wants to merge 1 commit into
vanshaggarwal27:mainfrom
ayushi2577:fix/extract-and-forward-topic-tags
Open

Fix: Extract LeetCode Topic Tags and Forward to Publishing Platforms#201
ayushi2577 wants to merge 1 commit into
vanshaggarwal27:mainfrom
ayushi2577:fix/extract-and-forward-topic-tags

Conversation

@ayushi2577

Copy link
Copy Markdown
Contributor

Fixes #170

Problem

Every blog post was published with the same 4 hardcoded tags (leetcode, dsa, programming, tutorial)
regardless of the actual problem topic. This killed discoverability on Dev.to and Hashnode.

Root Cause

content.js never extracted topic tags from the LeetCode DOM, so problem.tags
was always null at the backend, causing devto.py to always fall back to DEFAULT_TAGS.

Changes

File Change
extension/content.js Extract topic tags via a[href*="/tag/"], slice to 4, include in payload
extension/background.js Destructure topics from payload, forward to backend as tags
backend/devto.py No change — fallback to DEFAULT_TAGS only when tags is null

Testing

  • Tested on "Two Sum" (Array, Hash Table) → published with tags array, hash-table
  • Tested on a problem with no tags → falls back to DEFAULT_TAGS correctly ✅

No new dependencies required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] LeetCode Topic Tags Never Extracted — All Published Blogs Use Same 4 Hardcoded Tags

1 participant