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