diff options
author | Nat Lasseter <user@4574.co.uk> | 2025-03-10 11:40:28 +0000 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2025-03-10 11:40:28 +0000 |
commit | f72707126ee3c0bb161e9749485a27bf372e3527 (patch) | |
tree | 867d46f503f793b83ec2d09e72ae7db952e7b69c /cgi/user.cgi | |
parent | e905d0d7e03ee14bbde5a4d4cad16587919e5004 (diff) |
Remove unneccessary folder level
Diffstat (limited to 'cgi/user.cgi')
-rwxr-xr-x | cgi/user.cgi | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/cgi/user.cgi b/cgi/user.cgi new file mode 100755 index 0000000..00589e6 --- /dev/null +++ b/cgi/user.cgi @@ -0,0 +1,94 @@ +#!/usr/bin/env ruby + +require 'cgi' + +def llink(href, text) + if $cgi.path_info == href + $cgi.a(href) { "[ #{text} ⇓ ]" } + else + $cgi.a(href) { "[ #{text} ]" } + end +end + +def rlink(href, text) + $cgi.a(href: href, target: "_blank") { "[ #{text} ⇗ ] " } +end + +def toplinks + $cgi.table(id: "toplinks") { + $cgi.tr { + $cgi.td { llink("/" , "Home" ) } + + $cgi.td { rlink("https://git.4574.co.uk/", "Git" ) } + + $cgi.td { llink("/stuff-i-want" , "Stuff I Want") } + } + } +end + +def rquote + [ + "~ sweet ~", + "User_4574 uses Linux, and loves life.", + "User_4574 shall arrange the blocks and toil, for ever and a day.", + "User_4574 likes the number 7.", + "ex scientia veritas", + "User_4574 will blow things up for money.", + "User_4574 dreams it possible.", + "(define (! ?) (? ?)) (! !)", + "User_4574 lets her pain fade down.", + "User_4574 maintains vigilance during disablement conditions.", + "User_4574 is established on the localiser.", + "Memetic Hazard.", + "Every six months User_4574 checks the oil level of the drive housing, and if necessary tops up with IBM 15 to the level of the inspection hole.", + "User_4574 remembers tomorrow.", + "User_4574 <3s OpenBSD", + "Expectation is directly proportional to performance.", + "User_4574 is taking hits! Hull strength falling.", + "User_4574 is not on fire.", + "User_4574 syncs on green.", + "User_4574 always reads the plaque.", + "User_4574's work ethic is IEFBR14.", + "User_4574 clears the link pack area.", + "vivat diu et prosperet.", + "The White Zone is for loading and unloading only.", + "User_4574 copies run start.", + "User_4574 shows standby brie.", + "All hail the glow cloud.", + "User_4574 tries at all times, without surrender, to be on good terms with all people.", + "This is Delta Team. All production is down, repeat, all production is down.", + "User_4574 glows in the dark turning dust to gold.", + "NAT is evil.", + "User_4574 chooses to have the ball in hand behind the headstring.", + "User_4574 likes to think she could make Knuth cry if she wanted to.", + "Due to a lack of interest, tomorrow has been cancelled. We apologize for any inconvenience caused.", + "This is the panic office: Section 9-17 may have been hit. Activate the following procedure.", + "Nothing, and everything, is possimpable." + ].sample +end + +def page(title, jumbotitle = title) + load "#{title.downcase.gsub(?\s, ?-)}.cgi" + + $cgi.out { + $cgi.html { + $cgi.head { + $cgi.title { "User_4574's Lair / #{title}" } + + $cgi.link(rel: "stylesheet", href: "styles.css") + } + + $cgi.body { + $cgi.h1("class" => "jumbo") { jumbotitle } + + $cgi.div { toplinks } + + $page + + $cgi.div(id: "quote") { rquote } + } + } + } +end + +$cgi = CGI.new("html5") + +case $cgi.path_info +when "/" + page("Home", "User_4574's Lair") +when /^\/stuff-i-want/ + page("Stuff I Want") +end |