mirror of
https://salsa.debian.org/mdosch/feed-to-muc.git
synced 2024-12-22 21:05:25 +01:00
Refactored removetracking and added a new tracking parameter.
This commit is contained in:
parent
ca53b16a89
commit
8ac7a60770
1 changed files with 6 additions and 17 deletions
|
@ -18,25 +18,14 @@ func removeTracking(input string) (output string, err error) {
|
|||
return input, err
|
||||
}
|
||||
|
||||
// Remove the URL part starting with "?utm_", which is
|
||||
// used for tracking purposes.
|
||||
output = strings.Split(resp.Request.URL.String(), "?utm_")[0]
|
||||
output = resp.Request.URL.String()
|
||||
|
||||
// Remove the URL part starting with "?wt_", which is
|
||||
// used for Webtrekk tracking.
|
||||
output = strings.Split(output, "?wt_")[0]
|
||||
// Remove the URL part starting with known tracking parameters.
|
||||
trackingParameters := [6]string{"?utm_", "?wt_", "#ref=", "?ref=", "?pk_", "?source="}
|
||||
|
||||
// Remove the URL part starting with "#ref=", which is
|
||||
// used for tracking the referer by some feeds.
|
||||
output = strings.Split(output, "#ref=")[0]
|
||||
|
||||
// Remove the URL part starting with "?ref=", which is
|
||||
// used for tracking the referer by some feeds.
|
||||
output = strings.Split(output, "?ref=")[0]
|
||||
|
||||
// Remove the URL part starting with "?pk_", which is
|
||||
// used for tracking purposes.
|
||||
output = strings.Split(output, "?pk_")[0]
|
||||
for _, trackingParameter := range trackingParameters {
|
||||
output = strings.Split(output, trackingParameter)[0]
|
||||
}
|
||||
|
||||
return output, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue