I was playing around with PHP last night. I had found a couple of
applications fitting a need we have here for publishing quick news blurbs on
the web. The PHP versions were complicated (or appear so since I am just
learning PHP) and I kept getting parsing errors. But I loved the concept:
let any user drop a simple text file into a directory and the news
application publishes it neatly timestamped to the web. No knowledge needed
on the part of the user. Quick, simple, useful. Messaging at its best.

By the way, the only reason I'm messing with PHP at all is to interface with
MySQL databases. I'm hoping Rebol/command will render even this unnecessary.
PLEASE include a dialect for MySQL, Carl.<g>

But, back to my programming. Finally I slap myself on the forehead and utter
the discovery-word of that great philosopher, Homer Simpson. "DOH!" (Which,
giving Homer what little credit he deserves, is a lot easier to remember
than "Eureka!" and makes about as much sense--some of those old Greek
thinkers were all wet, huh?)

Yep, why mess around with PHP when such an application is purely trivial in
Rebol? I mean, REALLY trivial! Like less than five minutes to code a working
copy and put it live on the net. DOH!

To wit:


#!/rebol/rebol --cgi
REBOL[
        Name: "newsblurb.r"
        Author: {Ralph Roberts, ©1999 Creativity, Inc.}
        Purpose: {Display news articles in a directory.}
]

print "Content-Type: text/html^/"

dir: %/www/htdocs/newsblurbs/                ; specify directory

print "<H2 align='center'>NEWS</H2>"

print "<font face='COURIER' size='2'>"       ; just to make it look newsy

foreach file read dir [
         if not dir? dir/:file [
         print "<hr><blockquote><br><b><u>"
         date: modified? dir/:file        ; timestamp it using file's date
         print date/date
         print [date/time "</u></b>" ]
         item: read dir/:file

prin "<p>"
prin item
print "</p></blockquote>"

print "<br>"
   ]
]
print "</FONT><br>"


enjoy!

--Ralph

Reply via email to