Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/deploy-pages.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy to GitHub Pages

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
types: [opened, synchronize, reopened]
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: |
mkdir -p dist
cp -r * dist/ || true
cp -r .github dist/ || true

- name: Deploy to GitHub Pages (main)
if: github.ref == 'refs/heads/main'
uses: actions/deploy-pages@v4

- name: Deploy PR Preview
if: github.ref != 'refs/heads/main'
uses: rossjrw/pr-preview-action@v1.8.1
with:
source-dir: ./dist
preview-branch: gh-pages
umbrella-dir: preview
pr-number: ${{ github.event.pull_request.number }}
13 changes: 12 additions & 1 deletion tools.json
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
[]
[
{
"id": "fedi-username-normalizer",
"title": "Fedi Username Normalizer",
"description": "Convert Fediverse profile URLs to standard username@domain format.",
"icon": "🔄",
"category": "text",
"tags": ["fediverse", "mastodon", "username", "normalize", "social"],
"path": "tools/fedi-username-normalizer/index.html",
"enabled": true
}
]
165 changes: 165 additions & 0 deletions tools/fedi-username-normalizer/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fedi Username Normalizer</title>
<meta name="description" content="Convert Fediverse profile URLs to standard username@domain format">
<link rel="stylesheet" href="../../styles.css">
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
background: #f5f5f5;
}
h1 {
color: #333;
margin-bottom: 1.5rem;
}
.description {
color: #666;
margin-bottom: 2rem;
line-height: 1.6;
}
.container {
display: grid;
gap: 1.5rem;
}
.input-output-group {
display: grid;
gap: 1rem;
}
label {
font-weight: 600;
color: #444;
margin-bottom: 0.5rem;
display: block;
}
textarea {
width: 100%;
min-height: 150px;
padding: 1rem;
border: 2px solid #ddd;
border-radius: 8px;
font-size: 1rem;
font-family: monospace;
resize: vertical;
box-sizing: border-box;
}
textarea:focus {
outline: none;
border-color: #007bff;
}
.examples {
margin-top: 2rem;
padding: 1rem;
background: #e8f4fd;
border-radius: 8px;
border-left: 4px solid #007bff;
}
.examples h3 {
margin-top: 0;
color: #0056b3;
}
.examples ul {
margin: 0.5rem 0;
padding-left: 1.5rem;
}
.examples li {
margin: 0.25rem 0;
color: #333;
}
.examples code {
background: #fff;
padding: 0.1rem 0.3rem;
border-radius: 3px;
font-family: monospace;
font-size: 0.9rem;
}
</style>
</head>
<body>
<h1>🔄 Fedi Username Normalizer</h1>
<p class="description">
Convert Fediverse profile URLs into standard username@domain format.
Paste your URLs below and see the normalized usernames appear in real-time.
</p>

<div class="container">
<div class="input-output-group">
<label for="input-urls">Input URLs (one per line):</label>
<textarea
id="input-urls"
placeholder="https://sigmoid.social/@acedyyrug
https://sigmoid.social/@ate_ysyta
https://en.osm.town/@thibaultmol"
></textarea>
</div>

<div class="input-output-group">
<label for="output-usernames">Normalized Usernames:</label>
<textarea id="output-usernames" readonly></textarea>
</div>
</div>

<div class="examples">
<h3>Examples:</h3>
<ul>
<li><code>https://sigmoid.social/@acedyyrug</code> → <code>@acedyyrug@sigmoid.social</code></li>
<li><code>https://en.osm.town/@thibaultmol</code> → <code>@thibaultmol@en.osm.town</code></li>
<li><code>https://mastodon.social/@user</code> → <code>@user@mastodon.social</code></li>
</ul>
</div>

<script>
const inputTextarea = document.getElementById('input-urls');
const outputTextarea = document.getElementById('output-usernames');

function normalizeFediUrls(input) {
const lines = input.split('\n');
const results = [];

for (const line of lines) {
const trimmed = line.trim();
if (!trimmed) {
results.push('');
continue;
}

// Match Fediverse profile URLs
// Pattern: https://domain/@username or http://domain/@username
const match = trimmed.match(/^https?:\/\/([^\/]+)\/@([^\/\s]+)/i);

if (match) {
const domain = match[1];
const username = match[2];
results.push(`@${username}@${domain}`);
} else {
// If it doesn't match the expected format, leave it as-is
results.push(trimmed);
}
}

return results.join('\n');
}

function updateOutput() {
const input = inputTextarea.value;
const output = normalizeFediUrls(input);
outputTextarea.value = output;
}

// Update in real-time as user types
inputTextarea.addEventListener('input', updateOutput);
inputTextarea.addEventListener('paste', function() {
// Small delay to allow paste to complete
setTimeout(updateOutput, 10);
});

// Initial update
updateOutput();
</script>
</body>
</html>
Loading