I am looking for a helper tool/ script that can be used to power an application that presents some randomized content periodically eg once per day. Example applications are "One a Day Bridal Prep", "Daily Quotations", "Daily Programming Tips" etc etc It is simple enough to code one up myself but I am wondering if I don't need to reinvent the wheel here. I am working with php/mysql but am open to working with scripts that are made with other languages.
A:
If you want to make in PHP, do the following: create your PHP file that gets the quote of the day from the database, and run it once a day with a cronjob, redirect the output to a file and include the file in your desired webpage.
[EDIT:]
As Franz said, you can do it without a cronjob as well, cronjobs have the advantage of being able to run complex scripts (like getting content via cURL) and doing it in any scripting language you might think is "better".
Residuum
2009-11-08 01:46:27
There is no need for a cronjob here. If the script isn't called, nobody needs the outputs. It's simple to check whether we have a new day or not (or whether the quote of the day has been found already). Caching the result in a text file is fine, though.
Franz
2009-11-08 01:50:15
A:
fortune does this quite nicely. It's commonly found on unix systems. PEAR shows a PHP module for reading standard fortune files.
Robert Wohlfarth
2009-11-08 02:02:51
Interesting! I was completely unfamiliar with fortune. This would be a great to fallback on if I don't find a script/make one. I wonder where I can find the fortune source code....Thanks for the suggestion!
Eclatante
2009-11-08 02:13:28
A:
I actually found quite a few Quote of the Day application scripts from hotscripts.
http://www.hotscripts.com/category/php/scripts-programs/quote-display/
Eclatante
2009-11-08 06:40:17