Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Final URL

I keep getting tracking links as part of emails. They suck!

Use Val Town as a tracking shield - call this val and get redirected to the final URL at the end of the redirection chain without picking up trackers along the way.

https://neverstew-finalurl.web.val.run/<tracking_link>

Example

The Glastonbury registration lookup link.

https://neverstew-finalurl.web.val.run/https://scke65qh.r.eu-west-1.awstrack.me/L0/https:%2F%2Fglastonbury.seetickets.com%2Fregistration%2Flookup/2/01020189fe6dd832-f894deea-eab7-4d1d-8c6a-0818e87ac95c-000000/8f6rVLcCc3v6CQNroYC81q9YkaU=335

1
2
3
4
5
6
7
8
9
10
11
12
import { fetch } from "https://esm.town/v/std/fetch";
export async function finalUrl(req: Request) {
const url = new URL(req.url).pathname.replace(/^\//, "");
const response = await fetch(url);
return new Response("", {
headers: {
Location: response.url,
},
status: 302,
});
}
neverstew-finalurl.web.val.run
October 23, 2023