[SocialNetwork] Support additional userSource
values
#2
Labels
✨ Feature
New addition to the codebase (feature, utility, component, etc.)
userSource
values
#2
Currently, most social networks define their
user
handle in thepath
. 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 theSocialNetwork > SocialNetworkMatcher
interface that will allow developers to specify eitherMatchUserSource.Subdomain | MatchUserSource.Path
, withpath
being the default behaviour withinsocialite.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 theparameters
. If ever we have a reason to support this, we will need to either:MatchUserSource
userSource
The text was updated successfully, but these errors were encountered: