##############################################################################
#                       Random Text Generator v1.2                           #
#                       Random Quote/Fortune Script                          #
#                                                                            #
#                         Scripts Archive                                    #
#                    https://worldwidemart.com/scripts/                      #
##############################################################################

DESCRIPTION
-----------
Random Text Generator displays a random text selection from a file or
predefined list. Perfect for random quotes, tips of the day, fortunes,
taglines, or any rotating text content.

FEATURES
--------
* Random selection from text file or array
* Customizable entry separator
* HTML or plain text output
* Configurable HTML wrapper
* CSS class support

REQUIREMENTS
------------
* Unix-based web server with CGI support
* Perl 5.x or higher
* CGI module (usually included)

PACKAGE CONTENTS
----------------
rand_text.pl    - Main script
quotes.txt      - Sample quotes file
README          - This documentation

INSTALLATION
------------
1. Upload rand_text.pl to your cgi-bin directory
2. Set permissions: chmod 755 rand_text.pl
3. Create quotes.txt with your text entries
4. Set permissions: chmod 644 quotes.txt
5. Add to your page using SSI

TEXT FILE FORMAT
----------------
Entries are separated by a line containing only "%%":

  First quote or text entry.
  Can span multiple lines.
  — Attribution
  %%
  Second quote goes here.
  — Another Author
  %%
  Third quote or tip.
  %%

USAGE EXAMPLES
--------------
Basic SSI include:
  <div class="quote-of-the-day">
    <!--#include virtual="/cgi-bin/rand_text.pl" -->
  </div>

With custom styling:
  <style>
    .random-text {
      font-style: italic;
      border-left: 3px solid #007bff;
      padding-left: 15px;
      margin: 20px 0;
    }
  </style>
  <!--#include virtual="/cgi-bin/rand_text.pl" -->

CONFIGURATION
-------------
$text_file   - Path to file with text entries
$separator   - Line that separates entries (default: %%)
@texts       - Direct array of texts (overrides file)
$output_html - 1 for HTML output, 0 for plain text
$wrap_tag    - HTML tag to wrap output (e.g., 'blockquote')
$css_class   - CSS class for the wrapper element

COMMON USES
-----------
* Quote of the day
* Daily tips or hints
* Fortune cookie messages
* Rotating taglines/slogans
* Random facts
* Testimonial rotation
* Joke of the day

HISTORICAL CONTEXT
------------------
The Unix "fortune" program, which displays random quotes/jokes, inspired
many web versions. Random quote scripts were a staple of 1990s personal
homepages, often featuring inspirational quotes or humor.

MODERN ALTERNATIVES
-------------------
For random text in modern web development:

JavaScript (client-side):
  const quotes = [
    { text: "Quote one...", author: "Author" },
    { text: "Quote two...", author: "Author" }
  ];

  function displayRandomQuote() {
    const quote = quotes[Math.floor(Math.random() * quotes.length)];
    document.getElementById('quote').textContent = quote.text;
    document.getElementById('author').textContent = quote.author;
  }

  displayRandomQuote();

React component:
  const RandomQuote = ({ quotes }) => {
    const [quote, setQuote] = useState(quotes[0]);

    const newQuote = () => {
      setQuote(quotes[Math.floor(Math.random() * quotes.length)]);
    };

    return (
      <blockquote>
        <p>{quote.text}</p>
        <footer>{quote.author}</footer>
        <button onClick={newQuote}>New Quote</button>
      </blockquote>
    );
  };

Quote APIs:
* Quotable API (https://github.com/lukePeavey/quotable)
  Free, open source, no API key required

* They Said So (https://theysaidso.com/api/)
  Large database, various categories

* ZenQuotes (https://zenquotes.io)
  Free tier available

Example API usage:
  fetch('https://api.quotable.io/random')
    .then(response => response.json())
    .then(data => {
      console.log(`"${data.content}" — ${data.author}`);
    });

LICENSE
-------
Artistic License

##############################################################################
