From 464ae72894897f47cc4986bc9f81f7395aacf258 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Thu, 15 May 2025 15:49:29 -0400 Subject: [PATCH] Initial commit++ --- README.md | 8 +++++++- hr2.pl | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 hr2.pl diff --git a/README.md b/README.md index 31a9785..4323244 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ # hr2 -Sequel to the smash hit [Hyperlink-Redirect](https://git.seriousbusiness.international/swaggboi/Hyperlink-Redirect) \ No newline at end of file +Sequel to the smash hit +[Hyperlink-Redirect](https://git.seriousbusiness.international/swaggboi/Hyperlink-Redirect) + +## TODOs + +- Tests +- Fill in placeholder comments diff --git a/hr2.pl b/hr2.pl new file mode 100644 index 0000000..881fa2d --- /dev/null +++ b/hr2.pl @@ -0,0 +1,37 @@ +#!/usr/bin/env perl + +# May 2025 +# Jia Tan + +use Mojolicious::Lite -signatures; +use Mojo::Util qw{b64_decode b64_encode + gunzip gzip + url_escape url_unescape}; + +get '/', sub ($c) { $c->redirect_to('create') }; + +get '/create', sub ($c) { + $c->render; +}; + +post '/create', sub ($c) { + # Process the input... + + $c->render; +}; + +get '/--meta-refresh/*hyperlink', sub ($c) { + my $hyperlink = $c->param('hyperlink'); + # Process input... + + $c->redirect_to($hyperlink); +}; + +get '/*hyperlink', sub ($c) { + my $hyperlink = $c->param('hyperlink'); + # Process input... + + $c->redirect_to($hyperlink); +}; + +app->start;