commit
27dbe3d5e6
@ -0,0 +1 @@
|
||||
node_modules/
|
@ -0,0 +1,24 @@
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org/>
|
@ -0,0 +1,53 @@
|
||||
const express = require('express')
|
||||
const app = express()
|
||||
const port = 4003
|
||||
|
||||
app.use(express.static('static'))
|
||||
|
||||
function addProtocolIfMissing(str) {
|
||||
if (!str.startsWith('https://') && !str.startsWith('http://')) {
|
||||
str = 'https://'+str
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
|
||||
app.get('/:base64forTheWorld/:base64forTwitter', (req, res) => {
|
||||
let linkForTheWorld
|
||||
let linkForTwitter
|
||||
try {
|
||||
linkForTheWorld = addProtocolIfMissing(Buffer.from(req.params.base64forTheWorld, 'base64').toString('utf-8'))
|
||||
linkForTwitter = addProtocolIfMissing(Buffer.from(req.params.base64forTwitter, 'base64').toString('utf-8'))
|
||||
} catch (error) {
|
||||
res.status(400).send('idk what to do with this url! someone broke something.')
|
||||
return
|
||||
}
|
||||
if (req.headers['user-agent'].startsWith('Twitterbot/')) {
|
||||
console.log('found a twitter request lol')
|
||||
res.redirect(linkForTwitter)
|
||||
return
|
||||
}
|
||||
res.redirect(linkForTheWorld)
|
||||
})
|
||||
|
||||
app.get('/:base64forTheWorld/:base64forTwitter/*', (req, res) => {
|
||||
let linkForTheWorld
|
||||
let linkForTwitter
|
||||
try {
|
||||
linkForTheWorld = getValidUrl(Buffer.from(req.params.base64forTheWorld, 'base64').toString('utf-8'))
|
||||
linkForTwitter = getValidUrl(Buffer.from(req.params.base64forTwitter, 'base64').toString('utf-8'))
|
||||
} catch (error) {
|
||||
res.status(400).send('idk what to do with this url! someone broke something.')
|
||||
return
|
||||
}
|
||||
if (req.headers['user-agent'].startsWith('Twitterbot/')) {
|
||||
console.log('found a twitter request lol')
|
||||
res.redirect(linkForTwitter)
|
||||
return
|
||||
}
|
||||
res.redirect(linkForTheWorld)
|
||||
})
|
||||
|
||||
app.listen(port, '127.0.0.1', () => {
|
||||
console.log(`Example app listening on port ${port}`)
|
||||
})
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "fedishout",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.18.2"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 841 B |
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap" rel="stylesheet">
|
||||
<title>doing a little bit of trolling</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>doing a little bit of trolling</h1>
|
||||
<p>Wanna post a link, but have Twitter not notice? For some reason? This may be the tool for you ;)</p>
|
||||
<input placeholder="URL to redirect to here" autocomplete="off" type="url" name="link-for-the-world" id="link-for-the-world">
|
||||
<input placeholder="URL Twitter displays here" autocomplete="off" type="url" name="link-for-twitter" id="link-for-twitter">
|
||||
<div id="result-stuff" class="result-stuff" style="display: none">
|
||||
<p>Here's your URL to use on Twitter (don't blame me if you get banned lol):</p>
|
||||
<code id="result-link" class="result-link"></code>
|
||||
</div>
|
||||
<p>For example, put a link to your Mastodon profile in the first input box, and put a link to Elon's Twitter profile in the second box to make a link that looks like it goes to Elon's profile but goes to your Mastodon instead when clicked.</p>
|
||||
<div class="demo-graphic">
|
||||
<img src="/elon-link-card.png" alt="Screenshot of a Twitter card for Elon Musk's profile" class="link-card-graphic">
|
||||
<img src="/arrow.png" alt="arrow" class="arrow-graphic">
|
||||
<img src="/mastodon.svg" alt="mastodon logo" class="mastodon-graphic">
|
||||
</div>
|
||||
<p>(This could be used to make phishing links, sorry about that, but Twitter has had this unpatched for so long now and have been warned about this vulnerability multiple times, so they allowed this to happen.)</p>
|
||||
<br>
|
||||
<p>made with ❤️ by <a href="https://fuckgov.org">fuckgov.org</a></p>
|
||||
</body>
|
||||
<script>
|
||||
function isValidUrl(str) {
|
||||
return /^(https?:\/\/.)[-a-zA-Z0-9@:%._\+~#=]{2,256}\..{2,15}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/.test(str)
|
||||
}
|
||||
function onInputChange() {
|
||||
let worldLinkUrl = document.getElementById('link-for-the-world').value
|
||||
let twitterLinkUrl = document.getElementById('link-for-twitter').value
|
||||
if (!isValidUrl(worldLinkUrl)||!isValidUrl(twitterLinkUrl)) {
|
||||
document.getElementById('result-stuff').style.display = 'none'
|
||||
document.getElementById('result-link').innerText = 'invalid URLs (be sure both are proper URLs beginning with https://)'
|
||||
return
|
||||
}
|
||||
document.getElementById('result-stuff').style.display = 'block'
|
||||
worldLinkUrl = worldLinkUrl.replace(/https?:\/\//, '')
|
||||
twitterLinkUrl = twitterLinkUrl.replace(/https?:\/\//, '')
|
||||
let urlOfPage = new URL(window.location)
|
||||
urlOfPage.pathname = `/${btoa(worldLinkUrl).replace(/=/gm, '')}/${btoa(twitterLinkUrl).replace(/=/gm, '')}`
|
||||
document.getElementById('result-link').innerText = urlOfPage.href
|
||||
}
|
||||
document.getElementById('link-for-twitter').addEventListener('input', onInputChange)
|
||||
document.getElementById('link-for-the-world').addEventListener('input', onInputChange)
|
||||
</script>
|
||||
</html>
|
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,71 @@
|
||||
*, *::before, *::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'DM Sans', Arial, sans-serif;
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
input {
|
||||
background-color: black;
|
||||
color: white;
|
||||
border: 1px solid #2f3336;
|
||||
padding: 0.8rem 0.4rem;
|
||||
border-radius: 10px;
|
||||
display: block;
|
||||
margin: 0.4rem 0;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #2b90d9;
|
||||
}
|
||||
|
||||
.result-stuff {
|
||||
border: 1px solid #2f3336;
|
||||
padding: 0.8rem 0.4rem;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.result-link {
|
||||
display: block;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.result-stuff p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.demo-graphic {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.arrow-graphic {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.mastodon-graphic {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.link-card-graphic {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
|
||||
@media (min-width: 700px) {
|
||||
.demo-graphic {
|
||||
flex-direction: row;
|
||||
}
|
||||
.link-card-graphic {
|
||||
max-width: 70%;
|
||||
}
|
||||
.arrow-graphic {
|
||||
transform: none;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue