Skip to content

ahopp/punlink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”— PunLink

The URL shortener that takes itself way too seriously (or not)

PunLink is a hilariously over-engineered URL shortener that generates punny short URLs... or makes them absurdly, unnecessarily long. Because why settle for abc123 when you can have taco-bout-it or please/click/here/thank/you/very/much/absolutely-extraordinarily-magnificent-website?

✨ Features

🎭 Punny Short URLs

Instead of boring random characters, get creative slugs like:

  • link.ly/taco-bout-it
  • link.ly/url-be-sorry
  • link.ly/no-cap
  • link.ly/thats-what-sheet-said (for spreadsheets)
  • link.ly/brew-tiful (for coffee sites)

πŸ“ URL Lengthener Mode

Because who needs efficiency? Make URLs comically long:

  • link.ly/absolutely-extraordinarily-magnificent-website-you-will-ever-visit-seriously
  • link.ly/please/click/here/thank/you/very/much/super-mega-ultra-important-link

🎲 Surprise Me Mode

Can't decide? Let fate choose between punny short or ridiculously long!

🎯 Features

  • Themed pun categories: Food, Tech, Dad Jokes, General
  • Easter eggs: Special puns for specific domains (YouTube, GitHub, Google Sheets, etc.)
  • Click tracking: See which puns are most popular
  • Stats dashboard: View your punniest creations
  • Beautiful UI: Gradient backgrounds because it's 2025
  • Fully containerized: Docker + Docker Compose ready
  • SQLite database: Lightweight and portable

πŸš€ Quick Start

Using Docker Compose (Recommended)

# Clone the repository
git clone https://github.com/yourusername/punlink.git
cd punlink

# Build and run with Docker Compose
docker-compose up -d

# Visit http://localhost:5000

Using Docker

# Build the image
docker build -t punlink .

# Run the container
docker run -d -p 5000:5000 -v $(pwd)/data:/data punlink

# Visit http://localhost:5000

Local Development

# Install dependencies
pip install -r requirements.txt

# Run the app
python app/app.py

# Visit http://localhost:5000

πŸ“– API Documentation

Shorten URL (Punny Mode)

POST /shorten
Content-Type: application/json

{
  "url": "https://stackoverflow.com",
  "category": "tech"  # optional: food, tech, dad, general
}

# Response
{
  "slug": "stack-overflow-more-like-snack-overflow",
  "short_url": "http://localhost:5000/stack-overflow-more-like-snack-overflow",
  "original_url": "https://stackoverflow.com",
  "type": "pun"
}

Lengthen URL

POST /lengthen
Content-Type: application/json

{
  "url": "https://example.com",
  "super_long": false  # true for EXTREMELY long URLs
}

# Response
{
  "slug": "absolutely-extraordinarily-magnificent-website",
  "long_url": "http://localhost:5000/absolutely-extraordinarily-magnificent-website",
  "original_url": "https://example.com",
  "type": "long"
}

Surprise Me

POST /surprise
Content-Type: application/json

{
  "url": "https://example.com"
}

# Response - randomly picks between punny short or long
{
  "slug": "...",
  "url": "...",
  "original_url": "https://example.com",
  "type": "pun|surprise_long"
}

Get Stats

GET /stats        # HTML page
GET /api/stats    # JSON response

Redirect

GET /{slug}       # Redirects to original URL
                  # Supports nested slugs: /please/click/here/taco-bout-it

🎨 Easter Eggs

PunLink has special puns for specific domains:

  • YouTube: cat-video-incoming, definitely-not-rickroll
  • Stack Overflow: stack-overflow-more-like-snack-overflow, copy-paste-champion
  • GitHub: git-commit-m-fix-stuff, works-on-my-machine
  • Google Sheets: thats-what-sheet-said, spread-the-sheets
  • Starbucks: brew-tiful, espresso-yourself
  • Zoom: you-are-muted, can-you-see-my-screen
  • And many more!

πŸ“ Project Structure

punlink/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ app.py              # Main Flask application
β”‚   β”œβ”€β”€ pun_generator.py    # Pun generation logic
β”‚   β”œβ”€β”€ url_lengthener.py   # URL lengthening logic
β”‚   └── models.py           # Database models
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ index.html          # Main page
β”‚   β”œβ”€β”€ stats.html          # Stats page
β”‚   └── 404.html            # Error page
β”œβ”€β”€ static/
β”‚   └── style.css           # Styles
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ requirements.txt
└── README.md

πŸ› οΈ Technology Stack

  • Backend: Python 3.11 + Flask
  • Database: SQLite
  • Web Server: Gunicorn (production)
  • Containerization: Docker + Docker Compose
  • Frontend: Vanilla HTML/CSS/JavaScript (keeping it simple)

🌟 Example Usage

# Create a punny URL for a cat video
curl -X POST http://localhost:5000/shorten \
  -H "Content-Type: application/json" \
  -d '{"url": "https://youtube.com/watch?v=dQw4w9WgXcQ"}'

# Result: {"slug": "definitely-not-rickroll", ...}

# Create an absurdly long URL
curl -X POST http://localhost:5000/lengthen \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "super_long": true}'

# Access the URL
curl -L http://localhost:5000/definitely-not-rickroll
# Redirects to the original URL

🎯 Why Does This Exist?

Because the world needed more puns and less efficiency. Also:

  1. Regular URL shorteners are boring
  2. Dad jokes are underrepresented in tech
  3. Sometimes you want URLs to be longer, not shorter
  4. We have Docker, might as well use it
  5. SQLite deserves more love

🀝 Contributing

Have better puns? Found a bug? Want to add more ridiculous features?

  1. Fork the repo
  2. Create a feature branch
  3. Add your puns/features
  4. Submit a PR with a punny title

πŸ“ License

MIT License - Use it, abuse it, make it punnier.

πŸ™ Acknowledgments

  • Thanks to all the dad joke enthusiasts
  • Stack Overflow for the memes
  • Everyone who thought URL shorteners needed more personality

πŸ› Known Issues

  • Puns may cause eye-rolling
  • Long URLs might break your layout
  • May induce uncontrollable urge to make more puns
  • Not guaranteed to improve productivity (quite the opposite)

πŸ“ž Support

Having issues? Create an issue on GitHub. We promise to respond with at least one pun.


Remember: Life is too short for boring URLs. Make them punny. Or make them long. Or both. We're not here to judge.

Made with questionable humor and Python 🐍

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published