Created
December 15, 2023 14:15
-
-
Save louisbarclay/9176634b590626be085507561c246b1b to your computer and use it in GitHub Desktop.
Circumvent X Substack throttling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
async fetch(request) { | |
// Get the URL | |
const url = new URL(request.url); | |
// url.pathname will be our pathname to use in the HTML doc | |
// Change this to whatever your Substack subdomain is: | |
const subdomain = "12challenges"; | |
const html = `<!DOCTYPE html> | |
<head> | |
<script> | |
const stringArray = ["s","u","b","s","t","a","c","k"]; | |
window.location = "https://" + "${subdomain}" + "." + stringArray.join("") + ".com" + "${url.pathname}" | |
</script> | |
</head> | |
<body> | |
</body>`; | |
return new Response(html, { | |
headers: { | |
"content-type": "text/html;charset=UTF-8", | |
}, | |
}); | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment