urlmap

package
v0.0.0-...-44dfb0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 7 Imported by: 0

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 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

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL