Skip to content

Add Pinterest support (/pin/<id> and /@<handle>) #10

Description

@soxoj

Users report that Pinterest links are not handled — neither pins (https://pinterest.com/pin/<id>, also seen on country subdomains like in.pinterest.com) nor profiles (https://pinterest.com/@<handle>).

Both expose what we need through OG tags plus JSON-LD on the page.

Extracts: for a pin — uploader handle and pin title; for a profile — display name, avatar, and follower count when present.

Note on subdomains: country subdomains (in., ru., www.) must all match the same pattern. Please cover at least one of them in the test.

Where the code goes

  • New module sharetrace/modules/pinterest.py — one function, returns {"data": {...}} or {"error": "..."}.
  • Register it in router.py: URL pattern plus an entry in PARSERS.
  • Add output labels in output.py.
  • Unit test in tests/test_unit_modules.py — copy the shape of TestTelegram, mock the OG / JSON-LD HTML.
  • Add a row to the supported-sources table in README.md.

How you verify it — no credentials, no network

pytest tests/ --ignore=tests/test_integration.py

Unit tests mock requests at the module level, so this runs fully offline. tests/test_integration.py hits the live network and is excluded on purpose.

Done when

Both URL shapes return data, a country subdomain is covered by a test, README rows added.

Out of scope

Board listings, private pins, anything needing login.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions