Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SocialNetwork] Support additional userSource values #2

Open
beefchimi opened this issue Jan 16, 2022 · 0 comments
Open

[SocialNetwork] Support additional userSource values #2

beefchimi opened this issue Jan 16, 2022 · 0 comments
Labels
✨ Feature New addition to the codebase (feature, utility, component, etc.)

Comments

@beefchimi
Copy link
Owner

Currently, most social networks define their user handle in the path. Typically, it is the first segment, but occasionally it is proceeded by a directory such as /profiles/ or /users/.

There is at least one supported network that defines the user handle as a subdomain. substack has urls like: https://username.substack.com/.

To solve this, I introduced a userSource property to the SocialNetwork > SocialNetworkMatcher interface that will allow developers to specify either MatchUserSource.Subdomain | MatchUserSource.Path, with path being the default behaviour within socialite.ts. This isn't the most eloquent solution... but it works for now.

We may find some future social networks supporting different user handle definitions, such as in the parameters. If ever we have a reason to support this, we will need to either:

  1. Add another option to MatchUserSource
  2. Find a better solution to userSource
@beefchimi beefchimi added the ✨ Feature New addition to the codebase (feature, utility, component, etc.) label Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature New addition to the codebase (feature, utility, component, etc.)
Projects
None yet
Development

No branches or pull requests

1 participant