From f1e6949ea077ace594cbb5e92bfee90eba95e10a Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Wed, 30 Apr 2025 12:08:00 -0600 Subject: [PATCH 1/1] init --- .gitignore | 1 + ixtab | 40 ++++++++++++++++++++++++++++++++++++++++ tt/404 | 6 ++++++ tt/img | 6 ++++++ tt/index | 7 +++++++ 5 files changed, 60 insertions(+) create mode 100644 .gitignore create mode 100755 ixtab create mode 100644 tt/404 create mode 100644 tt/img create mode 100644 tt/index diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..db2fc0d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +secrets diff --git a/ixtab b/ixtab new file mode 100755 index 0000000..09bbff6 --- /dev/null +++ b/ixtab @@ -0,0 +1,40 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use CGI; +use DBI; +use Template; + +require "secrets"; # server data - shit that doesn't need to uploaded. + +my $cgi = CGI->new; + +my $tt = Template->new({ + INCLUDE_PATH => '.', + INTERPOLATE => 1, + }) or die Template->error(); + +# $dbfile from secrets +my $dbh = DBI->connect("dbi:SQLite:uri=file:$dbfile?mode=rwc"); + +my $path = $cgi->param('path') // ''; + +my %site = ( + ixtab => 'index', + img => 'img', + ); + +my $vars = ( + sneed => 'feed', + chuck => 'fuck', + ); + +my $page = $site{"$path"} // '404'; + +print $cgi->header( + -Content_Type => 'text/html', + -charset => 'UTF-8', + ); + +# I should probably put all of below into a buffer and run a pruning regexp on it +$tt->process('tt/' . $page, $vars) or die $tt->error(); diff --git a/tt/404 b/tt/404 new file mode 100644 index 0000000..7fbea0f --- /dev/null +++ b/tt/404 @@ -0,0 +1,6 @@ + + + +

Nothing Lost, Nothing Gained

+ + diff --git a/tt/img b/tt/img new file mode 100644 index 0000000..e733a1a --- /dev/null +++ b/tt/img @@ -0,0 +1,6 @@ + + + +

Image Board

+ + diff --git a/tt/index b/tt/index new file mode 100644 index 0000000..002aa39 --- /dev/null +++ b/tt/index @@ -0,0 +1,7 @@ + + + +

Glorious Day

+Imgb. + + -- 2.47.3