Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DomainFilters = map[string]func(*url.URL) bool{
"twitter.com": isLinkToTweet,
"x.com": isLinkToTweet,
"tiktok.com": isLinkToTikTokPost,
"instagram.com": isLinkToInstagramPost,
"reddit.com": isLinkToRedditPost,
}
DomainFilters is a mapping of domain names to filters for said domain name
View Source
var DomainReplacements = map[string]string{
"twitter.com": "fxtwitter.com",
"x.com": "fxtwitter.com",
"tiktok.com": "tiktxk.com",
"instagram.com": "ddinstagram.com",
"reddit.com": "rxddit.com",
}
DomainReplacements is a mapping of domain names to their replacements
Functions ¶
func MapURLs ¶
func MapURLs(domainReplacements map[string]string, filters map[string]func(*url.URL) bool, urls []string) []string
MapURLs maps the URLs according to the replacement and filter rules. Returns the replacement URLs.
- `domainReplacements` is a map of domains and their replacements
- `filters` map of domains to a filter function to filter out only certain requests. The function takes a URL (post-mapping, ie "https://fxtwitter.example/...") and returns true if the URL should be replaced.
Types ¶
type TiktxkResponse ¶
type TiktxkResponse struct {
Success bool `json:"success"`
}
TiktxkResponse is a struct which describes the success state of a tiktxk response
Click to show internal directories.
Click to hide internal directories.