Simple Question/Answer This project was realized just before Fine's birth to spread the news to family members.
Find a file
2017-06-05 20:07:11 +02:00
cache.manifest fixed html errors 2017-06-05 20:07:11 +02:00
edit.php changed feed file to feed.xml 2014-07-20 18:11:44 +02:00
index.template.html fixed html errors 2017-06-05 20:07:11 +02:00
README.md updated the read me file 2014-07-20 18:31:55 +02:00
rss.gif Added new RSS image 2014-07-20 18:13:33 +02:00

Welcome to SQA!

SQA is the abbreviation of "static question and answer".

This script creates webpages which display a question and its answer. You might have seen these kind of pages during in the interwebs in the past. Some good examples from Germany where:

  • Ist Guttenberg schon zurückgetreten?
  • Ist Christian Wulff schon zurückgetreten?
  • Ist Angela Merkel schon zurückgetreten?

However, I needed such a page for myself and created this script to be able to edit it easily, e.g. from a mobile phone.

Concept

There are several design decisions made with regard to the requirements I had:

  • Simplicity: I wanted to be able to modify the contents of the page easily (and from my mobile phone). On the other hand the page visitors should be get the information they want to have without any distractions. The information is also published via an RSS feed so users can subscribe to the feed and can get the information directly in their RSS reader.
  • Speed: I do not want to bother users so I decided to compile a static HTML everytime I update the page's contents instead of running a PHP script reading the values from a config file everytime a user visits the page. This is also a very good idea when a page is highly frequented.

Installation Process

Setting up the script is quite easy. You only need two things to do:

  1. Get the code!
  2. Make sure that the directory have the correct file persmission set (we need to write to that directory)

Get the code!

You can get the code from my personal GitLab or the backup repository hosted on GitHub.

git clone https://git.devpresso.org/fallenbeck/sqa.git

or

git clone https://github.com/fallenbeck/sqa.git

Set file permissions

This script needs to create and write to files in its directory. You must make sure that the user running the Webserver is able to write to this directory:

chmod 777 sqa

First run

You need to call the edit.php file directly:

http://your.web.site/edit.php

During the first run you must specify a password used for authentication later. You need to remember this password in order to log in and update the page in the future. Just follow the instructions on the screen, it's simple.

Update page

When updating the page at a later point in time, just call the edit.php directly in your webbrowser (see above). You need to enter the password to authenticate yourself and can update the question, the answer and the automatic update interval. You can also choose from a list of template files and change the template during an update process.

When saving your changes the PHP script will create a static HTML file (index.html) containing the information you just entered. Magic!

RSS?

Oh, yes. RSS will also be there when updating a page. The script does also create (or update) an feed.xml file holding your RSS feed contents. A link on the index.html file will be presented allowing your visitors to subscribe to that feed.

Starting over

If you want to start over (i.e. start from the beginning), you need to delete some files manually:

  • config.ini -- This file holds your configuration
  • feed.xml -- This file holds your (outdated) RSS feed
  • index.html -- This file is the static HTML file created by edit.php

Thereafter you can call edit.php directly in your browser and start ove r (see "First run" above).

Get Help!

If you have any questions regarding the code please contribute or get in contact with me: