Compare commits

..

2 Commits
sdf ... master

Author SHA1 Message Date
52f9d258d4 Update master README to contain info on the different branches
Signed-off-by: peteyboy <peteyboy@noreply.localhost>
2022-04-20 07:16:43 +00:00
a38abfdf7e Updated master branch to contain the CGI::Tiny version with mocked
PATH_INFO, but supporting a 'neutral' environment (not SDF), and playing
out of /cgi-bin.
2022-04-20 06:20:34 +00:00
2 changed files with 24 additions and 35 deletions

View File

@ -2,6 +2,12 @@
one-page app that turns wordle shares into standard file format used in the Conway's Game of Life community and sets it up for running in embedded Lifeviewer on the same page
## Project Branches
There are 3 branches to this project. There is just one CGI file and a version of the README.md in each one. Use the one that works for you. If at SDF, use the sdf branch. Otherwise master or mojo branches will work:
* *sdf* is the original branch, a CGI set up to run on SDF.org. I had to abandon using Mojolicious Lite, but found a nice way to do it using CGI:Tiny and the Mojo Templates. This version also uses a path_info URL parameter to manage routing, and mocks path_info, since is doesn't work on SDF's nginx web server setup.
* *master* is a branch made to be mostly the same as the SDF branch, using CGI::Tiny, but with more normal paths and not trying to pick out a separate user-level perl library. It still uses the path_info parameter, which actuall works pretty well for the simple case, I put it to, at least.
* *mojo* is a rewrite of the CGI part of the script using Mojolicious Lite and expecting that path_info is honored for CGI scripts. It uses routing based off the path_info (it's like *magic*) instead of a url parameter. I got this to run very nice with a handmade Mojolicous Daemon web server script, using the Mojolicous CGI plugin. It would have been so much less sweat to do this from the get-go, but I learned a lot banging my head against the wall, I guess.
## Dependencies
This app is not at all packaged. You'll have to make sure all the perl modules you need are installed. If you are on a community unix server with just user rights (like, say SDF), you may need to ask an admin to install for you, or alternately, you can make a personal perl library in your user space.

View File

@ -1,10 +1,9 @@
#!/usr/bin/perl
#Above is the particular location for system binaries in SDF's metaarray, not the usual spot
use strict;
use warnings;
use utf8;
#add my user perl library path, this is particular to each person's setup
use lib qw( /usr/lib/x86_64-linux-gnu/perl/5.36.0 /meta/p/peteyboy/perl5/lib/perl5 );
#use lib qw( /usr/pkg/lib/perl5/5.24.0 /meta/p/peteyboy/perl5/lib/perl5 );
#make request for all of the following
use CGI::Tiny;
use Mojo::Template;
@ -18,7 +17,7 @@ use experimental 'smartmatch';
# MAKE SURE ORIGIN PAGE MATCHES FILENAME (especially if you are testing changes)!
#
#===
my $ORIGIN_PAGE = "/wordle-life.cgi";
my $ORIGIN_PAGE = "/cgi-bin/wordle-life.cgi";
my $defaulttext = "Paste your wordle share here (replace this text)";
my $PATH_PARAM = "path_info";
my $WORDLE_INPUT_PARAM = "wordle-result";
@ -227,9 +226,7 @@ __DATA__
}
</style>
<meta name="LifeViewer" content="viewer textarea"> <!--required tag-->
<script src="lv-plugin.js"></script>
<p align= left> <a href="/"><-site Home</a>
<script src="/lv-plugin.js"></script>
</head>
@ -364,23 +361,11 @@ GRID
</ol>
<p>
<p>
<p>
<hr 100%>
<p> Made in February 2022</p>
<p><em>Disclaimer: <a href="https://git.sdf.org/peteyboy/wordle-life">I made this!</a> People and/or corporations may own their marks or copyrights, etc, on words mentioned on this site's pages I don't claim to</em></p>
<p>
<center>
Hosted by SDF.org
<p><a href="https://sdf.org"><img src=https://sdf.org/sdfbanner.png alt="SDF.org"></a>
</center>
</body></html>
@@ about.html.ep
<html>
<head>
@@ about.html.ep
<html>
<head>
<title>About Wordle-Life</title>
<link rel="stylesheet" href="https://unpkg.com/some-nice-basic-css/global.css" />
@ -388,32 +373,30 @@ Hosted by SDF.org
</head>
<body><h1>About</h1>
<body><h1>Wordle->Life</h1>
% my $home_path= "$ORIGIN_PAGE";
% my $current_path = "$home_path?path_info=/about";
<p>
<h2>Wordle->Life</h2>
<p>
<a href="https://git.sdf.org/peteyboy/wordle-life">I made this!</a> People and/or corporations may own their marks or copyrights, etc, on words mentioned on this site's pages I don't claim to.
<p> This is an about page. </p>
<p> Click <a href=<%== $home_path %> >here</a> to go Home </p>
<p> Click <a href=<%== $current_path %> >here</a> to stay put </p>
<p>
Questions, kudos or comments, mail me @sdf.org
<p>
Thanks to the community at <a href="https://conwaylife.com">conwaylife.com</a>, and the friendly folks in the forums there,
and for their <a href="https://conwaylife.com/wiki/Tutorials/LifeViewer_JavaScript_plug-in">Javascript Life Viewer</a>, which I use here.
</p>
<hr 100%>
<em>Disclaimer: I made this! People and/or corporations may own their marks or copyrights, etc, on words mentioned on this page I don't claim to</em>
<p>
Thanks to <a href="https://github.com/hankchizljaw/some-nice-basic-css"> hankchizljaw</a> for making his basic css publicly available
</p>
<p> Made in February 2022</p>
<p> Click <a href=<%== $home_path %> >here</a> to return to application Home </p>
<p> Made in February 2022
<p>
<center>
Hosted by SDF.org
<p><a href="https://sdf.org"><img src=https://sdf.org/sdfbanner.png alt="SDF.org"></a>
Hosted by Bisect Hosting
<p><a href="https://www.bisecthosting.com"><img src=https://www.bisecthosting.com/images/logos/logo.svg alt="bisecthosting.com" height= 10% width=auto></a>
</center>
</body></html>